Added creation of .bashrc file when not existing
This commit is contained in:
8
Makefile
8
Makefile
@@ -11,9 +11,13 @@ install:
|
|||||||
@echo "Installing required Python packages into ~/.venvs/pkgmgr..."
|
@echo "Installing required Python packages into ~/.venvs/pkgmgr..."
|
||||||
@~/.venvs/pkgmgr/bin/pip install --upgrade pip
|
@~/.venvs/pkgmgr/bin/pip install --upgrade pip
|
||||||
@~/.venvs/pkgmgr/bin/pip install -r requirements.txt
|
@~/.venvs/pkgmgr/bin/pip install -r requirements.txt
|
||||||
|
@echo "Ensuring ~/.bashrc exists..."
|
||||||
|
@test -f ~/.bashrc || touch ~/.bashrc
|
||||||
@echo "Ensuring automatic activation of ~/.venvs/pkgmgr for this user..."
|
@echo "Ensuring automatic activation of ~/.venvs/pkgmgr for this user..."
|
||||||
@grep -qxF 'if [ -d "$$HOME/.venvs/pkgmgr" ]; then export VIRTUAL_ENV="$$HOME/.venvs/pkgmgr"; export PATH="$$VIRTUAL_ENV/bin:$$PATH"; unset PYTHONHOME; fi' ~/.bashrc || echo 'if [ -d "$$HOME/.venvs/pkgmgr" ]; then export VIRTUAL_ENV="$$HOME/.venvs/pkgmgr"; export PATH="$$VIRTUAL_ENV/bin:$$PATH"; unset PYTHONHOME; fi' >> ~/.bashrc
|
@grep -qxF 'if [ -d "$$HOME/.venvs/pkgmgr" ]; then export VIRTUAL_ENV="$$HOME/.venvs/pkgmgr"; export PATH="$$VIRTUAL_ENV/bin:$$PATH"; unset PYTHONHOME; fi' ~/.bashrc \
|
||||||
@grep -qxF 'echo "Global Python virtual environment '\''~/.venvs/pkgmgr'\'' activated."' ~/.bashrc || echo 'echo "Global Python virtual environment '\''~/.venvs/pkgmgr'\'' activated."' >> ~/.bashrc
|
|| echo 'if [ -d "$$HOME/.venvs/pkgmgr" ]; then export VIRTUAL_ENV="$$HOME/.venvs/pkgmgr"; export PATH="$$VIRTUAL_ENV/bin:$$PATH"; unset PYTHONHOME; fi' >> ~/.bashrc
|
||||||
|
@grep -qxF 'echo "Global Python virtual environment '\''~/.venvs/pkgmgr'\'' activated."' ~/.bashrc \
|
||||||
|
|| echo 'echo "Global Python virtual environment '\''~/.venvs/pkgmgr'\'' activated."' >> ~/.bashrc
|
||||||
@echo "Installation complete. Please restart your shell (or 'exec bash') for the changes to take effect."
|
@echo "Installation complete. Please restart your shell (or 'exec bash') for the changes to take effect."
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
|
|||||||
Reference in New Issue
Block a user