-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall.sh
executable file
·77 lines (66 loc) · 2.08 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
if ! [ -x "$(command -v go)" ]; then
echo "installing go"
wget -q -O - https://git.io/vQhTU | bash
else
echo "go ok"
fi
OS="$(uname -s)"
ARCH="$(uname -m)"
case $OS in
"Linux")
case $ARCH in
"x86_64")
ARCH=amd64
;;
"aarch64")
ARCH=arm64
;;
"armv6" | "armv7l")
ARCH=armv6l
;;
"armv8")
ARCH=arm64
;;
.*386.*)
ARCH=386
;;
esac
PLATFORM="linux-$ARCH"
;;
"Darwin")
PLATFORM="darwin-amd64"
;;
esac
if [ -z "$PLATFORM" ]; then
echo "Your operating system is not supported by the script."
exit 1
fi
if [ -n "$($SHELL -c 'echo $ZSH_VERSION')" ]; then
shell_profile="$HOME/.zshrc"
elif [ -n "$($SHELL -c 'echo $BASH_VERSION')" ]; then
shell_profile="$HOME/.bashrc"
elif [ -n "$($SHELL -c 'echo $FISH_VERSION')" ]; then
shell="fish"
if [ -d "$XDG_CONFIG_HOME" ]; then
shell_profile="$XDG_CONFIG_HOME/fish/config.fish"
else
shell_profile="$HOME/.config/fish/config.fish"
fi
fi
#reload env variables
source $shell_profile
if [ -f ./bin/task ]; then
echo "task exists. install skipped"
else
echo "task does not exist. installing"
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
fi
#compile the tool
bin/task build-debug
# cp ./out/debug/bashy /usr/bin/bashy
# export PATH="$PATH:/root/.bashy/bin"
# echo 'export PATH="$PATH:/root/.bashy/bin"' >>~/.profile
#wget https://github.com/zeppaman/bashy/releases/download/v1.0.1/bashy
#curl -LO https://github.com/zeppaman/bashy/releases/download/v1.0.1/bashy && install -m 0755 ./bashy /usr/bin/bashy && rm ./bashy && echo 'export PATH="$PATH:$HOME/.bashy/bin"'>>~/.bashrc && echo 'export PATH="$PATH:$HOME/.bashy/bin"'>>~/.profile && echo 'export PATH="$PATH:$HOME/.bashy/bin"'>>/etc/environment && export PATH="$PATH:$HOME/.bashy/bin"
#sudo sh -c 'curl -LO https://github.com/zeppaman/bashy/releases/download/v1.0.1/bashy && install -m 0755 bashy /usr/bin/bashy && rm -rf bashy'