Compare commits
13 Commits
0fbcf46307
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e1ea39a90 | ||
|
|
cd8f2b7c0d | ||
|
|
48fe726f31 | ||
| 5d9b2d56e5 | |||
| ea86be7b01 | |||
| b7664ad8a7 | |||
| 37542773e3 | |||
| 7c8d81f080 | |||
| 854c19f35f | |||
| 87df4b6d7d | |||
| 8bca66a7bb | |||
|
|
8def65f683 | ||
|
|
563a29aa58 |
@@ -30,6 +30,7 @@ function main() {
|
|||||||
installMASApp 'Numbers' 409203825
|
installMASApp 'Numbers' 409203825
|
||||||
installMASApp 'Outbank' 1094255754
|
installMASApp 'Outbank' 1094255754
|
||||||
installMASApp 'Pages' 409201541
|
installMASApp 'Pages' 409201541
|
||||||
|
installMASApp 'Parallels Desktop' 1085114709
|
||||||
installMASApp 'Pixelmator Pro' 1289583905
|
installMASApp 'Pixelmator Pro' 1289583905
|
||||||
installMASApp 'SnippetsLab' 1006087419
|
installMASApp 'SnippetsLab' 1006087419
|
||||||
installMASApp 'Tim' 1449619230
|
installMASApp 'Tim' 1449619230
|
||||||
|
|||||||
@@ -55,9 +55,17 @@ function downloadHomebrew() {
|
|||||||
popd -q
|
popd -q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCanonicalBrewPath() {
|
||||||
|
local brewPath=${homebrew_directory}/bin/brew
|
||||||
|
if [[ $brewPath == $HOME* ]]; then
|
||||||
|
brewPath="\${HOME}${brewPath#$HOME}"
|
||||||
|
fi
|
||||||
|
echo $brewPath
|
||||||
|
}
|
||||||
|
|
||||||
function createBrewCallerScript() {
|
function createBrewCallerScript() {
|
||||||
local cmdPath=${HOME}/bin/brew
|
local cmdPath=${HOME}/bin/brew
|
||||||
local brewPath=${homebrew_directory}/bin/brew
|
local brewPath=`getCanonicalBrewPath`
|
||||||
[[ -f ${cmdPath} ]] && rm ${cmdPath}
|
[[ -f ${cmdPath} ]] && rm ${cmdPath}
|
||||||
mkdir -p ${cmdPath:h}
|
mkdir -p ${cmdPath:h}
|
||||||
cat <<- BREWCALLER > ${cmdPath}
|
cat <<- BREWCALLER > ${cmdPath}
|
||||||
@@ -74,13 +82,13 @@ function createBrewCallerScript() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createBrewPeriodicScript() {
|
function createBrewPeriodicScript() {
|
||||||
local brewCallerPath=${HOME}/bin/brew
|
local brewPath=`getCanonicalBrewPath`
|
||||||
local cmdPath=${HOME}/bin/brew-periodic
|
local cmdPath=${HOME}/bin/brew-periodic
|
||||||
[[ -f ${cmdPath} ]] && rm ${cmdPath}
|
[[ -f ${cmdPath} ]] && rm ${cmdPath}
|
||||||
mkdir -p ${cmdPath:h}
|
mkdir -p ${cmdPath:h}
|
||||||
cat <<- BREWCALLER > ${cmdPath}
|
cat <<- BREWCALLER > ${cmdPath}
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
local brew='${brewCallerPath}'
|
local brew='${brewPath}'
|
||||||
\$brew update
|
\$brew update
|
||||||
\$brew upgrade --greedy
|
\$brew upgrade --greedy
|
||||||
\$brew cleanup
|
\$brew cleanup
|
||||||
@@ -138,6 +146,10 @@ function getHomebrewDirectoryPath() {
|
|||||||
print -- ${homebrew_prefix:-$(getDefaultHomebrewPrefix)}/Homebrew
|
print -- ${homebrew_prefix:-$(getDefaultHomebrewPrefix)}/Homebrew
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDefaultGitHomebrewURL() {
|
||||||
|
print -- ${HOMEBREW_BREW_GIT_REMOTE:-https://github.com/Homebrew/brew.git}
|
||||||
|
}
|
||||||
|
|
||||||
function configureFolders() {
|
function configureFolders() {
|
||||||
local dirPath
|
local dirPath
|
||||||
for dirPath in ${HOME}/bin ${HOME}/.vim/{backups,swaps}; do
|
for dirPath in ${HOME}/bin ${HOME}/.vim/{backups,swaps}; do
|
||||||
|
|||||||
0
modules/00a-sudo-settings.sh
Normal file → Executable file
0
modules/00a-sudo-settings.sh
Normal file → Executable file
@@ -42,12 +42,11 @@ function ensureUserCanNoLongerRunPasswordlessSudo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFirstFreeRoleAccountID() {
|
function getFirstFreeRoleAccountID() {
|
||||||
local minUserID=450
|
local minUserID=200
|
||||||
local maxUserID=499
|
local maxUserID=400
|
||||||
local uname_machine=$(/usr/bin/uname -m)
|
if is-at-least 13.0 $(sw_vers -productVersion); then
|
||||||
if [[ ${uname_machine} == "arm64" ]]; then
|
minUserID=450
|
||||||
minUserID=200
|
maxUserID=499
|
||||||
maxUserID=400
|
|
||||||
fi
|
fi
|
||||||
dscl . -list '/Users' UniqueID | grep '_.*' | sort -n -k2 | awk -v i=${minUserID} '$2>='${minUserID}' && $2<'${maxUserID}' {if(i < $2) { print i; nextfile} else i=$2+1;} END {if(i <= '${maxUserID}' && ($2 < '${minUserID}' || $2 > '${maxUserID}')) print i;}'
|
dscl . -list '/Users' UniqueID | grep '_.*' | sort -n -k2 | awk -v i=${minUserID} '$2>='${minUserID}' && $2<'${maxUserID}' {if(i < $2) { print i; nextfile} else i=$2+1;} END {if(i <= '${maxUserID}' && ($2 < '${minUserID}' || $2 > '${maxUserID}')) print i;}'
|
||||||
}
|
}
|
||||||
@@ -207,9 +206,8 @@ function createBrewPeriodicScript() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function installHomebrewCore() {
|
function installHomebrewCore() {
|
||||||
export NONINTERACTIVE=1
|
[ ! -d $(getHomebrewRepositoryPath) ] || return
|
||||||
[ ! -d $(getHomebrewRepositoryPath) ] || return
|
NONINTERACTIVE=1 HOME= sudo --preserve-env=NONINTERACTIVE,HOME -u "${homebrew_username}" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
sudo --preserve-env=NONINTERACTIVE -u "${homebrew_username}" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
||||||
[ -d $(getHomebrewRepositoryPath) ]
|
[ -d $(getHomebrewRepositoryPath) ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,6 +355,7 @@ function getUsage() {
|
|||||||
|
|
||||||
if [[ "${ZSH_EVAL_CONTEXT}" == toplevel ]]; then
|
if [[ "${ZSH_EVAL_CONTEXT}" == toplevel ]]; then
|
||||||
test -f "${ASTZWEIG_MACOS_SYSTEM_LIB}" || { echo 'This module requires macos-system library. Please run again with macos-system library provieded as a path in ASTZWEIG_MACOS_SYSTEM_LIB env variable.'; return 10 }
|
test -f "${ASTZWEIG_MACOS_SYSTEM_LIB}" || { echo 'This module requires macos-system library. Please run again with macos-system library provieded as a path in ASTZWEIG_MACOS_SYSTEM_LIB env variable.'; return 10 }
|
||||||
|
autoload is-at-least
|
||||||
source "${ASTZWEIG_MACOS_SYSTEM_LIB}"
|
source "${ASTZWEIG_MACOS_SYSTEM_LIB}"
|
||||||
module_main $0 "$@"
|
module_main $0 "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
function brewInstall() {
|
function brewInstall() {
|
||||||
local identifier="$1"
|
local identifier="$1"
|
||||||
local cask="${2:+--cask}"
|
local cask="${2:+--cask}"
|
||||||
indicateActivity -- "Installing ${identifier}${cask:+ (Cask)}" ${homebrew_path} install -q ${cask} ${identifier}
|
HOME=/Users/Shared indicateActivity -- "Installing ${identifier}${cask:+ (Cask)}" sudo -u _homebrew ${homebrew_path} install -q ${cask} ${identifier}
|
||||||
}
|
}
|
||||||
|
|
||||||
function installCask() {
|
function installCask() {
|
||||||
@@ -59,7 +59,6 @@ function installBrews() {
|
|||||||
lop -y body:h1 -- -i 'Installing Homebrew formulas'
|
lop -y body:h1 -- -i 'Installing Homebrew formulas'
|
||||||
installBrew mas
|
installBrew mas
|
||||||
if ! isDebug; then
|
if ! isDebug; then
|
||||||
installBrew bun
|
|
||||||
installBrew chezmoi
|
installBrew chezmoi
|
||||||
installBrew cocogitto
|
installBrew cocogitto
|
||||||
installBrew composer
|
installBrew composer
|
||||||
@@ -67,6 +66,7 @@ function installBrews() {
|
|||||||
installBrew docker
|
installBrew docker
|
||||||
installBrew docker-buildx
|
installBrew docker-buildx
|
||||||
installBrew exiftool
|
installBrew exiftool
|
||||||
|
installBrew f2
|
||||||
installBrew ffmpeg
|
installBrew ffmpeg
|
||||||
installBrew gnupg
|
installBrew gnupg
|
||||||
installBrew go
|
installBrew go
|
||||||
|
|||||||
Reference in New Issue
Block a user