dev is a shell script to be sourced in your profile which enables fast pushing and popping of folders on stacks (colon-separated environment variables such as PATH and PYTHONPATH)
The main use is pushing one or several "dev" (a folder containing development executables and Python modules to be used in priority) while you iterate on your code, and "popping" them when you're done:
> dev
Pushed ~/work/myproject on PATH
> # Will use executables from this folder while you work on your code
> undev
Removed ~/work/myproject from PATH
dev tracks which paths have been added to which stack and only removes paths that it has added in order to leave you free to (reasonably) continue modifying your environment variables while you develop. It tries not to interfere with parts of stacks it is not responsible of.
dev also provides functions to push paths to arbitrary stacks:
> pushon LD_LIBRARY_PATH .
Pushed ~ on LD_LIBRARY_PATH
- clone this repository in a convenient location (e.g.
~/.local
) - source the dev in your shell profile (e.g. add
. ~/.local/dev/dev
to your~/.profile
)
dev
: Pushes$1
onPATH
and$1/bin
onPYTHONPATH
if it is a Python package with setup.py; otherwise like devbindevbin
: Pushes$1
onPATH
devpy
: Pushes$1
onPYTHONPATH
undev
: Pops$1
fromPATH
and$1/bin
fromPYTHONPATH
dev-status
: Prints the values ofPATH
andPYTHONPATH
, as well as the contents of all tracked stackspushon
,pushPATH
,pushPYTHONPATH
: Prepends$1
to the stack named$2
(fixed toPATH
andPYTHONPATH
for the 2 other versions)popfrom
,popPATH
,popPYTHONPATH
: Removes$2
(or the top of the stack by default: pop behavior) from the stack named$1
(fixed toPATH
andPYTHONPATH
for the 2 other versions)