-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·35 lines (24 loc) · 886 Bytes
/
setup.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
#!/bin/bash
parent_dir=$(pwd)
installation_dir=/tmp/bin
mkdir -p $installation_dir
cd $installation_dir || exit
go_download_url=https://go.dev/dl/$go_version
if ! command -v go &> /dev/null; then
# shellcheck disable=SC2059
printf "\ngo not available. installing go$go_version...\n"
wget $go_download_url
tar -C $installation_dir -xzf $installation_dir/$go_version
rm $go_version
# shellcheck disable=SC1090
echo "export GOROOT=$installation_dir/go;export GOBIN=$installation_dir/go/bin;export PATH=$PATH:$installation_dir:$GOROOT:$GOBIN" >> ~/.bashrc
# shellcheck disable=SC1090
source ~/.bashrc
fi
cd "$parent_dir" || exit
# Setup githooks
printf "\nsetting up git hooks\n"
. ./.githooks/prepare-hook.sh
printf "\nsetting up git commit message template\n"
git config commit.template .githooks/.gitmessage
git config commit.cleanup strip