Update 1 file: bootstrap.sh
This commit is contained in:
@@ -1,6 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# If piped, download and run as file so exec works
|
||||||
|
if [[ ! -t 0 ]]; then
|
||||||
|
TMP=$(mktemp /tmp/bootstrap.XXXXXX.sh)
|
||||||
|
curl -fsSL https://git.jeremymcclure.com/jeremy/dotstate-storage/raw/branch/master/default/.config/zsh/bootstrap.sh -o "$TMP"
|
||||||
|
chmod +x "$TMP"
|
||||||
|
exec "$TMP"
|
||||||
|
fi
|
||||||
|
|
||||||
# --- Helpers ---
|
# --- Helpers ---
|
||||||
|
|
||||||
info() { printf "\033[1;34m%s\033[0m\n" "$*"; }
|
info() { printf "\033[1;34m%s\033[0m\n" "$*"; }
|
||||||
@@ -8,13 +16,14 @@ warn() { printf "\033[1;33m%s\033[0m\n" "$*"; }
|
|||||||
error() { printf "\033[1;31m%s\033[0m\n" "$*"; }
|
error() { printf "\033[1;31m%s\033[0m\n" "$*"; }
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
dotstate activate
|
dotstate activate || true
|
||||||
|
|
||||||
sed -i.bak 's/^repo_mode\s*=\s*".*"/repo_mode = "Local"/' ~/.config/dotstate/config.toml || echo 'repo_mode = "Local"' >> ~/.config/dotstate/config.toml
|
sed -i.bak 's/^repo_mode\s*=\s*".*"/repo_mode = "Local"/' ~/.config/dotstate/config.toml || echo 'repo_mode = "Local"' >> ~/.config/dotstate/config.toml
|
||||||
|
|
||||||
dotstate doctor --fix
|
dotstate doctor --fix || true
|
||||||
dotstate activate
|
dotstate activate || true
|
||||||
|
|
||||||
|
info "done — restarting shell"
|
||||||
exec zsh
|
exec zsh
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user