File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ set -euo pipefail
99REPO_URL=" https://github.com/hperezrodal/bash-library"
1010SYSTEM_INSTALL=${SYSTEM_INSTALL:- false}
1111
12+ # Read version from version file
13+ VERSION=$( cat version)
14+
1215# Determine installation paths based on whether it's a system install
1316if [ " $SYSTEM_INSTALL " = " true" ]; then
1417 INSTALL_DIR=" ${BASH_LIBRARY_PATH:-/ usr/ local/ lib/ bash-library} "
@@ -79,6 +82,7 @@ if [ "$SYSTEM_INSTALL" = "true" ]; then
7982 # System-wide installation
8083 {
8184 echo " export BASH_LIBRARY_PATH=\" $INSTALL_DIR \" "
85+ echo " export BASH_LIBRARY_VERSION=\" $VERSION \" "
8286 echo " export PATH=\"\$ PATH:$BIN_DIR \" "
8387 echo " source \" $INSTALL_DIR /lib-loader.sh\" "
8488 } > " $PROFILE_DIR /bash-library.sh"
9195 {
9296 echo " # Bash Library"
9397 echo " export BASH_LIBRARY_PATH=\" $INSTALL_DIR \" "
98+ echo " export BASH_LIBRARY_VERSION=\" $VERSION \" "
9499 echo " export PATH=\"\$ PATH:$BIN_DIR \" "
95100 echo " source \" $INSTALL_DIR /lib-loader.sh\" "
96101 } >> " $shell_rc "
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ INSTALL_DIR="${BASH_LIBRARY_PATH:-/usr/local/lib/bash-library}"
1010BIN_DIR=" /usr/local/bin"
1111PROFILE_DIR=" /etc/profile.d"
1212
13+ # Read version from version file
14+ VERSION=$( cat version)
15+
1316# Check if running as root
1417if [ " $( id -u) " -ne 0 ]; then
1518 echo " This script must be run as root"
@@ -54,6 +57,7 @@ mkdir -p "$PROFILE_DIR"
5457{
5558 echo " # Bash Library"
5659 echo " export BASH_LIBRARY_PATH=\" $INSTALL_DIR \" "
60+ echo " export BASH_LIBRARY_VERSION=\" $VERSION \" "
5761 echo " export PATH=\"\$ PATH:$BIN_DIR \" "
5862 echo " source \" $INSTALL_DIR /lib-loader.sh\" "
5963} > " $PROFILE_DIR /bash-library.sh"
@@ -67,6 +71,7 @@ for shell_rc in ~/.bashrc ~/.zshrc; do
6771 {
6872 echo " # Bash Library"
6973 echo " export BASH_LIBRARY_PATH=\" $INSTALL_DIR \" "
74+ echo " export BASH_LIBRARY_VERSION=\" $VERSION \" "
7075 echo " export PATH=\"\$ PATH:$BIN_DIR \" "
7176 echo " source \" $INSTALL_DIR /lib-loader.sh\" "
7277 } >> " $shell_rc "
Original file line number Diff line number Diff line change 1+ v0.1.0
You can’t perform that action at this time.
0 commit comments