-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·49 lines (37 loc) · 832 Bytes
/
install
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
# ref: http://qiita.com/b4b4r07/items/24872cdcbec964ce2178#deploy
set -eu
has() {
return $(type $1 >/dev/null 2>&1)
}
REPO="github.com/izumin5210/dotfiles"
DOTPATH="${HOME}/src/${REPO}"
download() {
local github_url="https://${REPO}"
if has "git"; then
git clone --recursive "${github_url}" "${DOTPATH}"
elif has "curl" || has "wget"; then
tarball="${github_url}/archive/main.tar.gz"
if has "curl"; then
curl -L "${tarball}"
elif has "wget"; then
wget -O - "${tarball}"
fi | tar xv -
mv -f dotfiles-main "${dotpath}"
else
exit 1
fi
}
if [ ! -d $DOTPATH ]; then
download
fi
cd $DOTPATH
if [ $? -ne 0 ]; then
exit 1
fi
if [ "${CODESPACES:-"false"}" = "true" ]; then
./bin/deploy-config-files
else
echo "TODO: not yet implemented"
exit 1
fi