-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_ast-grep.sh
executable file
·44 lines (37 loc) · 1.33 KB
/
install_ast-grep.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
#!/bin/bash
if ! test -f checks/check_system.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/checks/check_system.sh)"
else
. ./checks/check_system.sh
fi
if ! test -f checks/check_completions_dir.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/checks/check_completions_dir.sh)"
else
. ./checks/check_completions_dir.sh
fi
if ! type update-system &> /dev/null; then
if ! test -f aliases/.bash_aliases.d/update-system.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/aliases/.bash_aliases.d/update-system.sh)"
else
. ./aliases/.bash_aliases.d/update-system.sh
fi
fi
if test -z $SYSTEM_UPDATED; then
readyn -Y "CYAN" -p "Update system?" updatesysm
if test $updatesysm == "y"; then
update-system
fi
fi
if ! type ast-grep &> /dev/null; then
if ! type cargo &> /dev/null; then
if ! test -f install_cargo.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/install_cargo.sh)"
else
./install_cargo.sh
fi
fi
cargo install ast-grep
if ! test -f ~/.bash_aliases.d/ast-grep; then
echo "$(ast-grep completions bash)" > ~/.bash_completion.d/ast-grep
fi
fi