Skip to content

Commit 531fad0

Browse files
authored
Support ZIGD_DIRECTORY in install.sh
1 parent ae099c0 commit 531fad0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

install.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@ if ! [ -x "$(command -v wget)" ]; then
55
exit 1
66
fi
77

8+
if [[ -z "${ZIGD_DIRECTORY}" ]]; then
9+
ZIGD_PATH=$HOME/.zigd
10+
else
11+
ZIGD_PATH=$ZIGD_DIRECTORY
12+
fi
13+
814
# Setup
9-
mkdir -p $HOME/.zigd/bin
15+
mkdir -p $ZIGD_PATH/bin
1016

1117
# Zigd
12-
wget https://github.com/trnxdev/zigd/releases/latest/download/zigd -O $HOME/.zigd/bin/zigd
13-
chmod +x $HOME/.zigd/bin/zigd
18+
wget https://github.com/trnxdev/zigd/releases/latest/download/zigd -O $ZIGD_PATH/bin/zigd
19+
chmod +x $ZIGD_PATH/bin/zigd
1420

1521
# Zigdemu
16-
wget https://github.com/trnxdev/zigd/releases/latest/download/zigdemu -O $HOME/.zigd/bin/zigdemu
17-
chmod +x $HOME/.zigd/bin/zigdemu
22+
wget https://github.com/trnxdev/zigd/releases/latest/download/zigdemu -O $ZIGD_PATH/bin/zigdemu
23+
chmod +x $ZIGD_PATH/bin/zigdemu
1824

1925
# Yipee! You installed zigd
2026
echo 'Succesfully installed! Now do `zigd setup [a zig version of your choice]`'
21-
echo 'Also, you have to add `export PATH=$HOME/.zigd/bin:$PATH` to your ~/.bashrc'
27+
echo "Also, you have to add `export PATH=${ZIGD_PATH}/bin:$PATH` to your ~/.bashrc"
2228
echo 'and then run `source ~/.bashrc` in this terminal to start using zigd!'
2329

2430
exit 0

0 commit comments

Comments
 (0)