Skip to content

Commit

Permalink
Add quiet flag to commands to reduce output noise
Browse files Browse the repository at this point in the history
  • Loading branch information
mmena1 committed Mar 15, 2024
1 parent 94d0a94 commit 193711e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ! _exists 1password ; then
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg
action "Installing 1password..."
sudo apt update && sudo apt install -y 1password
sudo apt -qq update && sudo apt -qq install -y 1password
{{ end }}
else
ok "Skipping"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{ if eq .chezmoi.os "linux" -}}
{{ if eq .chezmoi.os "linux" }}

{{ template "common" . -}}
{{ template "common" . }}

bot "Fira Code setup."

if ! fc-list | grep "Fira code" > /dev/null 2>&1; then
if ! fc-list | grep -qi "Fira Code" > /dev/null 2>&1; then
answer=$(prompt "Would you like to install Fira Code NerdFont to get cool icons on the terminal?")
if [[ $answer =~ ^[Yy]$ ]]; then
action "Downloading from https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FiraCode.zip"
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FiraCode.zip
wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FiraCode.zip && \
if [ -f "FiraCode.zip" ]; then
action "Unzipping and adding to ~/.fonts..."
unzip FiraCode.zip -d ~/.fonts
fc-cache -fv
action "rm -rf FiraCode.zip"
rm -rf FiraCode.zip
unzip -q FiraCode.zip -d ~/.fonts && \
fc-cache -f > /dev/null
action "Cleaning up..."
rm -f FiraCode.zip
else
error "Download failed. FiraCode.zip not found."
exit 1
Expand All @@ -26,4 +26,4 @@ else
ok "Fira Code already installed!"
fi

{{ end -}}
{{ end }}
4 changes: 2 additions & 2 deletions home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if ! _exists gh ; then
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
&& sudo apt -qq update \
&& sudo apt -qq install gh -y
{{ end -}}
else
ok "Skipping"
Expand Down
2 changes: 1 addition & 1 deletion home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if ! _exists eza ; then
action "Setting permissions..."
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
action "Installing..."
sudo apt update && sudo apt install -y eza
sudo apt -qq update && sudo apt -qq install -y eza
{{ end }}
else
ok "Skipping"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

{{ template "common" . -}}

brew update
brew bundle --no-lock --file=/dev/stdin <<EOF
bot "Updating homebrew packages"

brew update -q
brew bundle -q --no-lock --file=/dev/stdin <<EOF
{{ range .packages.darwin.brews -}}
brew {{ . | quote }}
{{ end -}}
Expand All @@ -14,4 +16,7 @@ tap {{ . | quote }}
cask {{ . | quote }}
{{ end -}}
EOF

ok

{{ end -}}
15 changes: 10 additions & 5 deletions home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{{ if eq .osid "linux-debian" -}}
#!/bin/bash
set -e
sudo apt-get update

{{ template "common" . -}}

bot "Updating apt packages"

sudo apt-get -qq update

{{ range .packages.debian.apt -}}
echo "Installing {{ . | quote }}..."
sudo apt-get install -y {{ . | quote }}
action "Installing {{ . | quote }}..."
sudo apt-get -qq install -y {{ . | quote }}
{{ end -}}

ok

{{ end -}}

0 comments on commit 193711e

Please sign in to comment.