zshify 13.3.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/script.zsh +26 -13
- package/package.json +1 -1
package/bin/script.zsh
CHANGED
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
#!/bin/zsh
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
git clone https://github.com/nrjdalal/zshify.git "$temp_dir" &>/dev/null
|
|
5
|
-
curl -s https://raw.githubusercontent.com/nrjdalal/pglaunch/main/bin/fx.sh | cat >"$temp_dir/config/postgres.zsh"
|
|
6
|
-
mkdir -p ~/.zshify
|
|
7
|
-
rsync -a --delete "$temp_dir"/ ~/.zshify/
|
|
8
|
-
rm -rf "$temp_dir"
|
|
3
|
+
command git -v &>/dev/null
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
if [ $? -ne 0 ]; then
|
|
6
|
+
echo
|
|
7
|
+
echo "Git is not available. Please Xcode Command Line Tools first\!"
|
|
8
|
+
xcode-select --install &>/dev/null
|
|
9
|
+
echo
|
|
10
|
+
return 1
|
|
11
|
+
fi
|
|
13
12
|
|
|
14
|
-
echo
|
|
15
|
-
echo "-------------- $(tput setaf 2)zshify successfully installed\!$(tput sgr0) --------------"
|
|
16
13
|
if ! command -v brew &>/dev/null; then
|
|
17
14
|
echo
|
|
18
|
-
echo "
|
|
15
|
+
echo "You cannot brew without the brew, right? Install brew first\!"
|
|
19
16
|
echo
|
|
20
17
|
echo "--- $(tput setaf 6)/bin/bash -c \"\$(curl -fsSL https://rdt.li/homebrew)\"$(tput sgr0) ---"
|
|
18
|
+
grep 'eval "$(/opt/homebrew/bin/brew shellenv)"' ~/.zshrc &>/dev/null || echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>~/.zshrc
|
|
19
|
+
echo
|
|
20
|
+
return 1
|
|
21
21
|
fi
|
|
22
|
+
|
|
23
|
+
TEMP_DIR=$(mktemp -d)
|
|
24
|
+
|
|
25
|
+
git clone https://github.com/nrjdalal/zshify "$TEMP_DIR" &>/dev/null
|
|
26
|
+
curl -s https://raw.githubusercontent.com/nrjdalal/pglaunch/main/bin/fx.sh | cat >"$TEMP_DIR/config/postgres.zsh"
|
|
27
|
+
rsync -a --delete "$TEMP_DIR"/ ~/.zshify/
|
|
28
|
+
|
|
29
|
+
for config in prompt background fx alias plugins user postgres; do
|
|
30
|
+
grep "source ~/.zshify/config/${config}.zsh" ~/.zshrc &>/dev/null || echo "source ~/.zshify/config/${config}.zsh" >>~/.zshrc
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
echo
|
|
34
|
+
echo "-------------- $(tput setaf 2)zshify successfully installed\!$(tput sgr0) --------------"
|
|
22
35
|
echo
|
|
23
|
-
echo "
|
|
36
|
+
echo "It is recommended to reload the shell, run $(tput setaf 3)exec zsh$(tput sgr0) to do so"
|
|
24
37
|
echo
|
|
25
38
|
|
|
26
39
|
[ -f ~/.zshrc ] && grep -vxFf ~/.zshify/config/user.zsh ~/.zshrc >~/.zshrc.tmp && mv ~/.zshrc.tmp ~/.zshrc
|