generated from xxh/xxh-plugin-zsh-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·38 lines (31 loc) · 958 Bytes
/
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
#!/usr/bin/env bash
CDIR="$(cd "$(dirname "$0")" && pwd)"
build_dir=$CDIR/build
while getopts A:K:q option
do
case "${option}"
in
q) QUIET=1;;
A) ARCH=${OPTARG};;
K) KERNEL=${OPTARG};;
esac
done
rm -rf $build_dir
mkdir -p $build_dir
for f in pluginrc.zsh
do
cp $CDIR/$f $build_dir/
done
cd $build_dir
[ $QUIET ] && arg_q='-q' || arg_q=''
[ $QUIET ] && arg_s='-s' || arg_s=''
[ $QUIET ] && arg_progress='' || arg_progress='--show-progress'
ohmyzsh_home=$build_dir/ohmyzsh
if [ -x "$(command -v git)" ]; then
git clone $arg_q --depth 1 https://github.com/ohmyzsh/ohmyzsh.git $ohmyzsh_home
git clone $arg_q --depth 1 https://github.com/zsh-users/zsh-autosuggestions $ohmyzsh_home/custom/plugins/zsh-autosuggestions
git clone $arg_q --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ohmyzsh_home/custom/plugins/zsh-syntax-highlighting
else
echo "git is not installed. Please install it first."
exit 1
fi