-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e431af2
commit e07607c
Showing
7 changed files
with
65 additions
and
167 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
..._once_before_0000-decrypt_age_key.sh.tmpl → ...run_once_before_0-decrypt_age_key.sh.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
dotfiles/.chezmoiscripts/runOnce/run_once_before_1-darwin.sh.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{{- if eq .chezmoi.os "darwin" -}} | ||
#!/usr/bin/env zsh | ||
|
||
# ----------------------------------- | ||
# author: @kiliantyler | ||
# title: Installs Xcode Command Line Tools | ||
# description: Installs Xcode Command Line Tools if they are not already installed | ||
# ----------------------------------- | ||
|
||
fail() { | ||
echo "$1" >&2 | ||
exit 1 | ||
} | ||
|
||
|
||
# ----------------------------------- | ||
# Ensure we are running in zsh | ||
# Make this check POSIX compliant | ||
# ----------------------------------- | ||
|
||
if [ -z "${ZSH_VERSION:-}" ]; then | ||
fail "Please run this script in zsh" | ||
fi | ||
|
||
should_install_command_line_tools() { | ||
! [[ -e "/Library/Developer/CommandLineTools/usr/bin/git" ]] | ||
} | ||
|
||
chomp() { | ||
printf "%s" "${1/"$'\n'"/}" | ||
} | ||
|
||
# ----------------------------------- | ||
# Xcode Command Line Tools Installation | ||
# ----------------------------------- | ||
|
||
if should_install_command_line_tools; then | ||
echo "Installing Xcode Command Line Tools" | ||
# This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools | ||
clt_placeholder="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress" | ||
command sudo touch "${clt_placeholder}" | ||
|
||
clt_label_command="/usr/sbin/softwareupdate -l | | ||
grep -B 1 -E 'Command Line Tools' | | ||
awk -F'*' '/^ *\\*/ {print \$2}' | | ||
sed -e 's/^ *Label: //' -e 's/^ *//' | | ||
sort -V | | ||
tail -n1" | ||
clt_label="$(chomp "$(/bin/bash -c "${clt_label_command}")")" | ||
|
||
if [[ -n "${clt_label}" ]] | ||
then | ||
command sudo "/usr/sbin/softwareupdate" "-i" "${clt_label}" | ||
command sudo "/usr/bin/xcode-select" "--switch" "/Library/Developer/CommandLineTools" | ||
fi | ||
command sudo "/bin/rm" "-f" "${clt_placeholder}" | ||
fi | ||
|
||
{{ end }} |
113 changes: 0 additions & 113 deletions
113
dotfiles/.chezmoiscripts/runOnce/run_once_before_1-install-programs.sh.tmpl
This file was deleted.
Oops, something went wrong.
File renamed without changes.
8 changes: 0 additions & 8 deletions
8
dotfiles/.chezmoiscripts/runOnce/run_once_before_2-comtrya.sh.tmpl
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
dotfiles/.chezmoiscripts/runOnce/run_once_before_3-nerdfont.sh.tmpl
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
dotfiles/.chezmoiscripts/runOnce/run_once_before_4-gpg-keys.sh.tmpl
This file was deleted.
Oops, something went wrong.