-
Notifications
You must be signed in to change notification settings - Fork 1
/
test
executable file
·66 lines (52 loc) · 1.52 KB
/
test
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
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env fish
function pass --argument-names message;
echo [(set_color green) OK (set_color normal)] $message
end
function fail --argument-names message;
echo [(set_color red) FAIL (set_color normal)] $message
exit 1
end
set INSTALLED_FILES_PATHS \
"$HOME/.gitconfig" \
"$HOME/.gitmessage" \
"$HOME/.npmrc" \
"$HOME/.config/fish/config.fish" \
"$HOME/.config/starship.toml" \
"$HOME/Library/Application Support/Code/User/settings.json"
set INSTALLED_DIRECTORIES_PATHS \
"$HOME/.config/fish/functions"
whereis fish
fish --version
whereis starship
starship --version
whereis node
node --version
whereis code
code --version
whereis docker
docker --version
whereis aws
aws --version
set VSCODE_INSTALLED_EXTENSIONS (code --list-extensions)
set NUMBER_OF_VSCODE_EXTENSIONS_INSTALLED (count $VSCODE_INSTALLED_EXTENSIONS)
for FILE in $INSTALLED_FILES_PATHS;
# if a symbolic link and a non-empty file
if test -L "$FILE" && test -s "$FILE"
pass "$FILE is a symbolic link file"
else
fail "$FILE is not a symbolic link file"
end
end
for DIRECTORY in $INSTALLED_DIRECTORIES_PATHS;
# if a symbolic link and a directory
if test -L "$DIRECTORY" && test -d "$DIRECTORY"
pass "$DIRECTORY is a symbolic link directory"
else
fail "$DIRECTORY is not a symbolic link directory"
end
end
if test $NUMBER_OF_VSCODE_EXTENSIONS_INSTALLED -gt 0
pass "$NUMBER_OF_VSCODE_EXTENSIONS_INSTALLED Visual Studio Code extensions installed successfully"
else
fail "Visual Studio Code extensions installation failed"
end