mirror of
https://github.com/js0ny/dotfiles.git
synced 2026-02-04 03:20:32 +00:00
Add script log for elevation scripts.
This commit is contained in:
parent
2a1127bf10
commit
6ee67769a6
25 changed files with 102 additions and 99 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
# shellcheck shell=sh
|
||||
|
||||
echo "[INFO] Running neovim healthcheck"
|
||||
|
||||
if command -v nvim > /dev/null 2>&1; then
|
||||
nvim --headless +checkhealth +"w nvim-healthcheck.txt" +qall
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
|
||||
set +x
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "Use TouchID to authenticate before running sudo commands."
|
||||
echo "WARNING: This operation modifies critical system files."
|
||||
echo "If something goes wrong, you may need to boot into macOS Recovery Mode to restore your system."
|
||||
echo "To continue, type EXACTLY 'yes' and press Enter."
|
||||
echo "[INFO] Use TouchID to authenticate before running sudo commands."
|
||||
echo "[WARNING] This operation modifies critical system files."
|
||||
echo " If something goes wrong, you may need to boot into macOS Recovery Mode to restore your system."
|
||||
echo "[ACTION] To continue, type EXACTLY 'yes' and press Enter."
|
||||
read -p "Do you want to continue? (yes/no): " response
|
||||
if [ "$response" != "yes" ]; then
|
||||
echo "Operation cancelled."
|
||||
echo "[INFO] Operation cancelled."
|
||||
exit 0 # Exit with success status code
|
||||
fi
|
||||
echo ""
|
||||
|
||||
|
||||
set -x
|
||||
sudo cp ~/.dotfiles/misc/mac/etc/pam.d/sudo /etc/pam.d/sudo
|
||||
set +x
|
||||
|
|
|
|||
5
home/.chezmoiscripts/linux/run_once_after_fonts.sh
Normal file
5
home/.chezmoiscripts/linux/run_once_after_fonts.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "[INFO] Rebuilding fonts cache..."
|
||||
|
||||
fc-cache -fv
|
||||
|
|
@ -1,8 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Check if firefox is installed
|
||||
if ! command -v firefox &> /dev/null; then
|
||||
echo "[WARNING] Firefox is not installed. Skip this script."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
src=~/.dotfiles/misc/firefox/search.json.mozlz4
|
||||
dest=~/.mozilla/firefox/*.default/search.json.mozlz4
|
||||
if ! cmp -s "$src" "$dest" 2>/dev/null; then
|
||||
echo "[INFO] search.json.mozlz4 is updated, copying..."
|
||||
cp "$src" "$dest"
|
||||
fi
|
||||
|
||||
|
|
@ -11,7 +18,9 @@ fi
|
|||
src=~/.dotfiles/misc/firefox/policies.json
|
||||
dest=/etc/firefox/policies/policies.json
|
||||
if ! cmp -s "$src" "$dest" 2>/dev/null; then
|
||||
sudo cp "$src" "$dest"
|
||||
echo "[INFO] policies.json is updated, copying..."
|
||||
echo "[ACTION] elevation required"
|
||||
sudo cp "$src" "$dest" && exit 0
|
||||
fi
|
||||
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
fc-cache -fv
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
# shellcheck shell=sh
|
||||
|
||||
sudo cp $CHEZMOI_SOURCE_DIR/dot_config/bash/xdg-compat.sh /etc/profile.d/xdg-compat.sh
|
||||
12
home/.chezmoiscripts/unixlike/run_once_bash.sh.tmpl
Normal file
12
home/.chezmoiscripts/unixlike/run_once_bash.sh.tmpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
# shellcheck shell=sh
|
||||
|
||||
{{ if .wheel }}
|
||||
|
||||
echo "[ACTION] Elevation required: "
|
||||
echo " Setting XDG Environment Variables to global scope"
|
||||
sudo cp $CHEZMOI_SOURCE_DIR/.chezmoitemplates/bash_profile /etc/profile.d/xdg-compat.sh
|
||||
|
||||
{{ else }}
|
||||
|
||||
{{ end }}
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "[INFO] Running: zsh-set-env.sh"
|
||||
|
||||
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||
|
||||
{{ if .wheel }}
|
||||
|
||||
echo "[INFO] "
|
||||
|
||||
if [ -f /etc/zshenv ]; then
|
||||
sudo cp "$CHEZMOI_SOURCE_DIR/dot_config/zsh/global.zshenv" /etc/zshenv
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue