-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
59 lines (48 loc) · 1.96 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Bumpster installation script
### Begin define variables ###
home=$(sh -c "echo ~$(whoami)") # Define user's home directory
BUMPSTER_HOME="$home/.bumpster" # Directory where Bumpster will be installed
bin_dir="$BUMPSTER_HOME/bin" # Directory for binary files
version_url="https://github.com/phoenixweiss/Bumpster/archive/refs/heads/main.tar.gz" # GitHub archive URL
### End define variables ###
# Check for required tools
if ! command -v curl &> /dev/null; then
echo "curl is required for installation. Please install curl and try again."
exit 1
fi
# Create the necessary directories if they do not exist
mkdir -p "$bin_dir"
# Download and extract the latest version of Bumpster from GitHub
echo "Downloading and installing the latest version of Bumpster..."
curl -L -# "$version_url" | tar -zxf - --strip-components 1 -C "$BUMPSTER_HOME"
# Source functions.sh
source "$BUMPSTER_HOME/config.sh"
source "$BUMPSTER_HOME/lib/functions.sh"
# Check if 'bump' command is already in use
if command -v bump &>/dev/null; then
echo "The command 'bump' is already in use. Wrapper for 'bumpster' will not be created."
create_bump_wrapper="false"
else
create_bump_wrapper="true"
fi
# Pass the variable to post_install
export create_bump_wrapper
# Perform post-installation steps
post_install
# Check if the bin directory is already in the PATH
if [[ ":$PATH:" == *":$bin_dir:"* ]]; then
echo "Bumpster's bin directory is already in your PATH."
else
echo "Bumpster has been installed successfully in $bin_dir."
echo "However, to use Bumpster from any directory, you need to add it to your PATH."
echo ""
echo "Please manually add the following line to your shell configuration file (e.g., ~/.bashrc or ~/.bash_profile):"
echo ""
echo " export PATH=\"$bin_dir:\$PATH\""
echo ""
echo "Then, reload your shell configuration by running:"
echo " source ~/.bashrc # or the equivalent for your shell"
fi
# Final message
echo "Bumpster installation completed."