-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.sh
51 lines (40 loc) · 911 Bytes
/
__init__.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
#!/bin/bash
if [[ -n $CI ]]; then
env | sort
set -x # for debugging in github actions
fi
# shellcheck disable=SC2034
architecture=$(uname -m)
platform='unknown'
unamestr=$(uname)
if [[ $unamestr == 'Linux' ]]; then
platform='linux'
elif [[ $unamestr == 'Darwin' ]]; then
# shellcheck disable=SC2034
platform='darwin'
fi
function exitAndShow() {
echo "failed to pushd ... exiting"
read -r -p
exit 1
}
pushd ~/.bashrc.d > /dev/null || exitAndShow
# shellcheck disable=SC1091
source init_tools.sh
for file in tools/*.sh; do
# shellcheck disable=SC1090
source "$file"
done
set +o errexit # deactivate exit on error
set +o xtrace # deactivate tracing
# shellcheck disable=SC2164
popd > /dev/null
function linkFile() {
local file=$1
if [ ! -f "$HOME/$file" ]; then
echo "first time linked '$file'"
ln -vfs "$HOME/.bashrc.d/$file" ~
fi
}
linkFile .inputrc
linkFile .vimrc