To cd into the development directory of the current topic.
implementation
To have be, which is a Python application, change the current directory of it’s parent process, in this case bash. One alternative is to make be the base command into a command-line script, and have each subcommand routed to the Python program, except command-line specific commands such as home, which is treated by the shell script directly.
$ be # bash
$ be new ad # Python
$ be home # bash
Here's an example be.bat to replace the default Python callable.
@echo off
if "%1" == "home" (
cd %BE_DEVELOPMENTDIR%
) else python -m be %*
In this case, all commands that is nothome is routed to Python, whereas home is handled by cmd.exe.
problem
The apparent problem is that we can now no longer rely on pip to install this executable for us, complicating deployment and thereafter adoption. I.e. users can't simply run pip install and get with it, they will not have to manually create and shuffle around files.
We can work around it by creating a dedicated installed, but then again we loose the advantage of pip being familiar and thus eases adoption.
goal
To
cd
into the development directory of the current topic.implementation
To have be, which is a Python application, change the current directory of it’s parent process, in this case bash. One alternative is to make
be
the base command into a command-line script, and have each subcommand routed to the Python program, except command-line specific commands such ashome
, which is treated by the shell script directly.Here's an example
be.bat
to replace the default Python callable.In this case, all commands that is not
home
is routed to Python, whereashome
is handled by cmd.exe.problem
The apparent problem is that we can now no longer rely on
pip
to install this executable for us, complicating deployment and thereafter adoption. I.e. users can't simply runpip install
and get with it, they will not have to manually create and shuffle around files.We can work around it by creating a dedicated installed, but then again we loose the advantage of
pip
being familiar and thus eases adoption.