split after script to before and after
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
echo "[-] Running installation script [-]"
|
echo "[-] Running post-installation script [-]"
|
||||||
|
|
||||||
|
|
||||||
{{- if eq .chezmoi.os "linux" }}
|
{{- if eq .chezmoi.os "linux" }}
|
||||||
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
||||||
@@ -9,19 +10,16 @@ echo "Alpine Linux detected"
|
|||||||
{{- else if (eq .chezmoi.osRelease.id "debian" "ubuntu" "zorin") }}
|
{{- else if (eq .chezmoi.osRelease.id "debian" "ubuntu" "zorin") }}
|
||||||
|
|
||||||
echo "Debian-based Linux detected"
|
echo "Debian-based Linux detected"
|
||||||
echo "\n[-] Adding fish package repository [-]"
|
|
||||||
sudo apt-add-repository ppa:fish-shell/release-3
|
|
||||||
sudo apt install -y fish
|
|
||||||
|
|
||||||
{{- else }}
|
{{- else }}
|
||||||
echo "Linux OS release not recognized"
|
echo "Linux OS release not recognized"
|
||||||
exit 1
|
exit 1
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
echo "\n[-] Downloading Nerd Fonts [-]"
|
|
||||||
if test -f ~/.fonts/GeistMonoNerdFontMono-Regular.otf; then
|
if test -f ~/.fonts/GeistMonoNerdFontMono-Regular.otf; then
|
||||||
echo "GeistMono already installed"
|
echo "GeistMono Nerd Font already installed"
|
||||||
else
|
else
|
||||||
|
echo "\n[-] Downloading Nerd Fonts [-]"
|
||||||
curl -L -O https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.zip && \
|
curl -L -O https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.zip && \
|
||||||
unzip GeistMono.zip -d ~/.fonts && \
|
unzip GeistMono.zip -d ~/.fonts && \
|
||||||
rm GeistMono.zip && \
|
rm GeistMono.zip && \
|
||||||
@@ -29,38 +27,48 @@ else
|
|||||||
echo "Failed to download GeistMono.zip"
|
echo "Failed to download GeistMono.zip"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "\n[-] Setting default shell to fish [-]"
|
|
||||||
chsh -s $(which fish) || echo "chsh failed"
|
|
||||||
|
|
||||||
{{- else if eq .osid "darwin" }}
|
{{- else if eq .osid "darwin" }}
|
||||||
|
|
||||||
echo "macOS detected"
|
echo "macOS detected"
|
||||||
echo "\n[-] Setting default shell to fish [-]"
|
|
||||||
chsh -s $(which fish) || echo "chsh failed"
|
if test -f ~/Library/Fonts/GeistMonoNerdFontMono-Regular.otf; then
|
||||||
|
echo "GeistMono Nerd Font already installed"
|
||||||
|
else
|
||||||
|
echo "\n[-] Downloading Nerd Fonts [-]"
|
||||||
|
curl -L -O https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.zip && \
|
||||||
|
unzip GeistMono.zip -d ~/Library/Fonts && \
|
||||||
|
rm GeistMono.zip && \
|
||||||
|
echo "GeistMono installed" || \
|
||||||
|
echo "Failed to download GeistMono.zip"
|
||||||
|
fi
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
echo "\n[-] Installing webman [-]"
|
# check if $SHELL is fish already
|
||||||
if test -x ~/.webman/bin/webman; then
|
|
||||||
echo "webman already installed"
|
if echo $SHELL | grep "fish" ; then
|
||||||
|
echo "Fish shell already set up"
|
||||||
else
|
else
|
||||||
curl https://raw.githubusercontent.com/candrewlee14/webman/main/scripts/install.sh | sh
|
echo "\n[-] Setting default shell to fish [-]"
|
||||||
|
chsh -s $(which fish) || echo "chsh failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "\n[-] Installing nvim [-]"
|
|
||||||
|
|
||||||
if test -x ~/.webman/bin/nvim; then
|
if test -x ~/.webman/bin/nvim; then
|
||||||
echo "nvim already installed"
|
echo "nvim already installed"
|
||||||
else
|
else
|
||||||
|
echo "\n[-] Installing nvim [-]"
|
||||||
~/.webman/bin/webman add nvim
|
~/.webman/bin/webman add nvim
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "\n[-] Running fish install setup [-]"
|
echo "\n[-] Running fish install setup [-]"
|
||||||
/usr/bin/env fish ~/.config/fish/.on_install.fish
|
/usr/bin/env fish ~/.config/fish/.on_install.fish
|
||||||
|
|
||||||
echo "\n[-] Installing AstroNvim [-]"
|
|
||||||
if test -f ~/.config/nvim/config.ld ; then
|
if test -f ~/.config/nvim/config.ld ; then
|
||||||
echo "Already installed AstroNvim"
|
echo "Already installed AstroNvim"
|
||||||
else
|
else
|
||||||
|
echo "\n[-] Installing AstroNvim [-]"
|
||||||
if test -d ~/.config/nvim/ ; then
|
if test -d ~/.config/nvim/ ; then
|
||||||
echo "Moving current nvim config to nvim.bak"
|
echo "Moving current nvim config to nvim.bak"
|
||||||
mv ~/.config/nvim ~/.config/nvim.bak || echo ""
|
mv ~/.config/nvim ~/.config/nvim.bak || echo ""
|
||||||
@@ -73,4 +81,4 @@ else
|
|||||||
else
|
else
|
||||||
echo "~/.webman/bin/nvim does not exist or is not executable"
|
echo "~/.webman/bin/nvim does not exist or is not executable"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
46
run_once_before_install.sh.tmpl
Normal file
46
run_once_before_install.sh.tmpl
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
echo "[-] Running pre-installation script [-]"
|
||||||
|
|
||||||
|
{{- if eq .chezmoi.os "linux" }}
|
||||||
|
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
||||||
|
|
||||||
|
echo "Alpine Linux detected"
|
||||||
|
{{- else if (eq .chezmoi.osRelease.id "debian" "ubuntu" "zorin") }}
|
||||||
|
|
||||||
|
echo "Debian-based Linux detected"
|
||||||
|
echo "\n[-] Adding fish package repository [-]"
|
||||||
|
|
||||||
|
# if fish already installed then skip adding repository
|
||||||
|
if test -x /usr/bin/fish; then
|
||||||
|
echo "Fish already installed"
|
||||||
|
else
|
||||||
|
sudo apt-add-repository ppa:fish-shell/release-3
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y fish
|
||||||
|
fi
|
||||||
|
|
||||||
|
{{- else }}
|
||||||
|
echo "Linux OS release not recognized"
|
||||||
|
exit 1
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- else if eq .osid "darwin" }}
|
||||||
|
|
||||||
|
echo "macOS detected"
|
||||||
|
|
||||||
|
if test -x /usr/local/bin/brew; then
|
||||||
|
echo "Homebrew already installed"
|
||||||
|
else
|
||||||
|
echo "\n[-] Installing Homebrew [-]"
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
echo "\n[-] Installing webman [-]"
|
||||||
|
if test -x ~/.webman/bin/webman; then
|
||||||
|
echo "webman already installed"
|
||||||
|
else
|
||||||
|
curl https://raw.githubusercontent.com/candrewlee14/webman/main/scripts/install.sh | sh
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user