Skip to content

Commit 0dba9a6

Browse files
committed
feat: library version
1 parent 6439c9f commit 0dba9a6

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

install-remote.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ set -euo pipefail
99
REPO_URL="https://github.com/hperezrodal/bash-library"
1010
SYSTEM_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
1316
if [ "$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"
@@ -91,6 +95,7 @@ else
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"

install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ INSTALL_DIR="${BASH_LIBRARY_PATH:-/usr/local/lib/bash-library}"
1010
BIN_DIR="/usr/local/bin"
1111
PROFILE_DIR="/etc/profile.d"
1212

13+
# Read version from version file
14+
VERSION=$(cat version)
15+
1316
# Check if running as root
1417
if [ "$(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"

version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.1.0

0 commit comments

Comments
 (0)