A utility for validating paths in environment variables and modifying them safely
Project description
Path-diag
A utility for validating paths in environment variables and modifying them safely.
Prerequisites
- Python 3
Installation
You can install path-diag
via pip
:
pip3 install path-diag
Usage
Diagnose environment variable problems
Check if $PATH
contains any invalid paths:
$ pathdiag
$PATH
is the default variable to check.
You can specify another variable. For example:
$ pathdiag --var PYTHONPATH
You can also specify an increased verbosity which will also print the paths that are successfully checked:
$ pathdiag -v
✓ /usr/local/bin
✓ /usr/bin
✓ /bin
✓ /usr/sbin
✓ /sbin
Safely append/prepend paths to environment variables
You can use the bash functions in order to take advantage of this features by adding the following line on top of your .bashrc
/.zshrc
file:
source /usr/local/bin/path-diag-functions.sh
Then you can use the safe_append
/safe_prepend
functions. For example:
safe_append "/usr/local/Cellar/node/7.4.0/bin"
safe_prepend "/usr/local/opt/python/libexec/bin"
This will add /usr/local/Cellar/node/7.4.0/bin
at the end of $PATH
if this path passes the validation checks, and will also add /usr/local/opt/python/libexec/bin
at the beginning of $PATH
, again if no errors are identified.
Contributing
All contributions are welcomed. Make sure your code passes flake8
checks and that is auto-formatted using black
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file path-diag-0.0.1.tar.gz
.
File metadata
- Download URL: path-diag-0.0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4da715633c8a8a5b2640d9cd6be92c6c12b0468bfc8a3aee11e9adf860f3adc |
|
MD5 | ca93fb67e605999ba3797e10060c9eb7 |
|
BLAKE2b-256 | c57ede49081b51043ae17a7ba6009452affd42edac44bbbe9709769282856470 |
File details
Details for the file path_diag-0.0.1-py3.6.egg
.
File metadata
- Download URL: path_diag-0.0.1-py3.6.egg
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a75956e9a003c390d27aeb41b5351e27d17799570f6c1045476197d9b407d7d |
|
MD5 | dafc4f4f699b54a87cbc08223379c3b2 |
|
BLAKE2b-256 | bb366c2f4f21a9a066120d774392907e44c1c0621d90296a1c746fb0c518e0b1 |
File details
Details for the file path_diag-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: path_diag-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c249b0a9cf919b6b6723417866a08fe45775459b384a04ad158d2f83902ef9f9 |
|
MD5 | 23a47c43e440e8ef530387277a6d01c1 |
|
BLAKE2b-256 | 132a5cb9749884d7c63dcc1e24ecb1c1ecde2dd5ed127bb0d6011663f92c7947 |