Allow for system-wide installations

This commit is contained in:
JeremyStar™ 2023-11-13 04:42:51 +01:00
parent bf11b14bdc
commit 233e049662
2 changed files with 14 additions and 4 deletions

View file

@ -13,11 +13,19 @@ This is a premade and fully-fletched bashrc, fully configurable to your liking.
- ytfzf
## Usage
### Installing
### Installing (user-wide)
```bash
git clone https://git.staropensource.de/JeremyStarTM/jstmbash.git ${HOME}/.jstmbash # clone repository
git clone https://git.staropensource.de/JeremyStarTM/jstmbash.git "${HOME}/.jstmbash" # clone repository
echo "source \${HOME}/.jstmbash/init.source" >> "${HOME}/.bashrc" # add init script to bashrc
cp ${HOME}/.jstmbash/config.env.example ${HOME}/.jstmbash/config.env # copy example config
${EDITOR} ${HOME}/.jstmbash/config.env # configure jstmbash
cp "${HOME}/.jstmbash/config.env.example" "${HOME}/.jstmbash/config.env" # copy example config
"${EDITOR}" "${HOME}/.jstmbash/config.env" # configure jstmbash
exec bash # restart bash
```
### Installing (system-wide)
```bash
git clone https://git.staropensource.de/JeremyStarTM/jstmbash.git /etc/jstmbash # clone repository
echo "source /etc/jstmbash/init.source" >> "/etc/bash.bashrc" # add init script to bashrc
cp "/etc/jstmbash/config.env.example" "/etc/jstmbash/config.env" # copy example config
"${EDITOR}" "/etc/jstmbash/config.env" # configure jstmbash
exec bash # restart bash
```

View file

@ -13,6 +13,8 @@ fi
# source configuration file
if [ -f "${HOME}/.jstmbash/config.env" ] && [ "${JSTMBASH_LOCAL_CONFIG}" != "true" ]; then
source "${HOME}/.jstmbash/config.env"
elif [ -f "/etc/jstmbash/config.env" ] && [ "${JSTMBASH_LOCAL_CONFIG}" != "true" ]; then
source "/etc/jstmbash/config.env"
elif [ -f "$(pwd)/config.env" ]; then
source "$(pwd)/config.env"
else