forked from everettraven/packageless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunixInstaller.sh
34 lines (27 loc) · 1008 Bytes
/
unixInstaller.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
#!/bin/sh
shell=$(echo ${SHELL##*/})
echo "Installing packageless on shell: $shell"
echo "Creating any needed directories"
if [ ! -d "$HOME/bin" ]
then
mkdir ~/bin
fi
if [ ! -d "$HOME/.packageless" ]
then
mkdir ~/.packageless
mkdir ~/.packageless/pims_config
mkdir ~/.packageless/pims
fi
echo "Downloading the executable..."
if [ -z "${OSTYPE##*darwin*}" ]
then
curl -L -o ~/bin/packageless https://github.com/everettraven/packageless/releases/latest/download/packageless-macos
else
curl -L -o ~/bin/packageless https://github.com/everettraven/packageless/releases/latest/download/packageless-linux
fi
chmod +x ~/bin/packageless
echo "Downloading packageless configuration file"
curl -L -o ~/.packageless/config.hcl https://github.com/everettraven/packageless/releases/latest/download/config.hcl
echo "Adding packageless to PATH by adding to: ~/."$shell"rc"
echo "export PATH=\$PATH:~/bin" >> $HOME"/."$shell"rc"
echo "For changes to take effect, please restart your terminal"