Skip to main content

No project description provided

Project description

status release ci release

Exec-cmds-defer-errors

Small Python script that executes given commands commands and defers errors.

The standalone script is called exec_cmds_defer_errors.py and can be found here. The license is included in the file.

Here it is used to run three commands:

uv run --script exec_cmds_defer_errors.py \
  'whoami | grep goatse' \
  'echo "hello world"' \
  'make love' \
  'sleep 1.5'

Note that in the example the script is executed with uv run, a subcommand of uv, which is a package manager for Python. This is because the script contains inline script metadata specifying required dependencies. The script also contains a shebang, so it can be executed directly.

The output will look like this (but colored):

Executing command 1...
whoami | grep goatse
Executed command 1 failed with exit code 1. Took 0.00 seconds.
Executing command 2...
echo "hello world"
hello world
Executed command 2 successfully. Took 0.00 seconds.
Executing command 3...
make love
make: *** No rule to make target 'love'.  Stop.
Executed command 3 failed with exit code 2. Took 0.00 seconds.
Executing command 4...
sleep 1.5
Executed command 4 successfully. Took 1.50 seconds.
2 out of 4 command(s) failed.
Command 1 failed with exit code 1: whoami | grep goatse
Command 3 failed with exit code 2: make lovew

Shell completion

This program uses Click for the CLI. Click provides automatically generated shell completion for Bash, Fish, and Zsh. Check out the official documentation here.

Project status

The project is maintained by me, Tim, and I am interested in keeping it alive as I am actively using it.

I'm also using the project to test out various tools and workflows.

Versioning

The project follows Semantic Versioning.

Contributing

Contributions are welcome. Please refer to CONTRIBUTE.md.

Licensing

This work is licensed under the ISC license. See LICENSE for the license text.

The license is also included in the script exec_cmds_defer_errors.py itself.

Template

This project is based on the following Copier template: https://github.com/trallnag/copier-template-python-script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exec_cmds_defer_errors-2.1.1.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exec_cmds_defer_errors-2.1.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file exec_cmds_defer_errors-2.1.1.tar.gz.

File metadata

  • Download URL: exec_cmds_defer_errors-2.1.1.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for exec_cmds_defer_errors-2.1.1.tar.gz
Algorithm Hash digest
SHA256 8594514b9eae9f44092932a8ca5789eca5b82d211f161877f0ec6cf6a1551e29
MD5 375349b91a7a8afbe07bb94eead3e8ce
BLAKE2b-256 828152a2dc2d65466f43fb000a7b65f608ca2ab3c75c349b6d3967be16b92615

See more details on using hashes here.

Provenance

The following attestation bundles were made for exec_cmds_defer_errors-2.1.1.tar.gz:

Publisher: release.yaml on trallnag/exec-cmds-defer-errors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file exec_cmds_defer_errors-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for exec_cmds_defer_errors-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bdd8a6fca2e8474e3bf321b90f353448cb222a912ba2a1a365f466c8eab2e3d5
MD5 9d1df7759ca02d240f1be74103436dad
BLAKE2b-256 ff36cc10a0b367ff3798d1ccbcbb6bfdf42a5e8c1529863db12d7b12f5f0fae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for exec_cmds_defer_errors-2.1.1-py3-none-any.whl:

Publisher: release.yaml on trallnag/exec-cmds-defer-errors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page