Add installation script

This commit is contained in:
lachtan
2024-09-01 17:15:11 +02:00
parent 7f6686b3d4
commit 2c1cb9e9dc
2 changed files with 18 additions and 0 deletions

View File

@@ -10,6 +10,12 @@ Add to $HOME/.bashrc file:
source $full_path_to_repository/bashrc source $full_path_to_repository/bashrc
``` ```
or install by script
```bash
./install.sh
```
After that each bash login is ready to offer full functionality. After that each bash login is ready to offer full functionality.
For faster load can be set For faster load can be set

12
install.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -E -o errexit -o nounset -o pipefail
if grep -q -e 'source\s+.*/linux-workspace/bashrc\s*$' $HOME/.bashrc; then
echo "Linux Workspace configuration already exists in .bashrc !"
exit 1
else
readonly SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
echo "Adding to $HOME/.bashrc"
echo "source '$SCRIPT_DIR/bashrc'" >> "$HOME/.bashrc"
fi