-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.fish
executable file
·56 lines (39 loc) · 1.08 KB
/
install.fish
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
52
53
54
55
56
# Copyright (c) 2023 DMascot
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
set -x REPOSITORY "https://github.com/dmascot/tools.git"
set -x DEST_DIR "/tmp/tools"
function is_prerequisites_satisfied --description "Check Prerequisites"
if command -q git
echo "git found....OK"
else
echo "Install git command!"
false
end
if test -f "$HOME/.config/fish/functions/bass.fish"
echo "bass found....OK"
else
echo "Install bass from https://github.com/edc/bass"
false
end
end
function clone_repository --description "Clone repository"
echo "cloning tools repository to $DEST_DIR"
git clone $REPOSITORY $DEST_DIR 1>/dev/null 2>&1
end
function run_setup --description "Run setup command"
echo "Installing Tools"
cd $DEST_DIR && source setup.fish && cd - 1>/dev/null 2>&1
end
function clean_up --description "Clean up install dir"
echo "Cleaning $DEST_DIR"
rm -rf $DEST_DIR
end
function main
is_prerequisites_satisfied
clone_repository
run_setup
clean_up
end
main