-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.sh
executable file
·49 lines (38 loc) · 1.02 KB
/
build.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
#!/usr/bin/env bash
CDIR="$(cd "$(dirname "$0")" && pwd)"
while getopts A:K:q option
do
case "${option}"
in
q) QUIET=1;;
A) ARCH=${OPTARG};;
K) KERNEL=${OPTARG};;
esac
done
build_dir=$CDIR/build
rm -rf $build_dir
mkdir -p $build_dir/zsh-bin
for f in entrypoint.sh zsh.sh
do
cp $CDIR/$f $build_dir/
done
cp $CDIR/zshrc $build_dir/.zshrc
# tag=$(curl --silent https://api.github.com/repos/romkatv/zsh-bin/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
tag=v3.0.1
distfile=zsh-5.8-linux-x86_64
url="https://github.com/romkatv/zsh-bin/releases/download/$tag/$distfile.tar.gz"
tarname=`basename $url`
cd $build_dir/zsh-bin
[ $QUIET ] && arg_q='-q' || arg_q=''
[ $QUIET ] && arg_s='-s' || arg_s=''
[ $QUIET ] && arg_progress='' || arg_progress='--progress bar'
if [ -x "$(command -v wget)" ]; then
wget $arg_q $arg_progress $url -O $tarname
elif [ -x "$(command -v curl)" ]; then
curl $arg_s -L $url -o $tarname
else
echo Install wget or curl
fi
tar -xzf $tarname
mv zsh-5.8-linux-x86_64/* .
rm $tarname