diff --git a/home/.chezmoiscripts/universal/run_before_05-system.sh.tmpl b/home/.chezmoiscripts/universal/run_before_05-system.sh.tmpl index d1fdd9db..007e3196 100644 --- a/home/.chezmoiscripts/universal/run_before_05-system.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_before_05-system.sh.tmpl @@ -767,6 +767,20 @@ addFlathub() { fi } +installXcode() { + if [ -d /Applications ] && [ -d /System ]; then + if [ ! -d /Applications/Xcode.app ]; then + logg info 'Installing Xcode via mas - the installation will timeout after 40 minutes if Apple account is not signed into' + timeout 2400 mas install 497799835 || MAS_EXIT_CODE=$? + if [ -n "$MAS_EXIT_CODE" ]; then + logg error 'Failed to install Xcode' + fi + else + logg success 'Xcode is already installed' + fi + fi +} + setupLinuxHomebrewFonts() { if [ ! -d /Applications ] && [ ! -d /System ]; then logg info 'Tapping homebrew/linux-fonts' && brew tap homebrew/linux-fonts @@ -788,6 +802,7 @@ miscMacOs() { # TODO - Add install on macOS for macports if [ -n "$DEBUG" ] || [ -n "$DEBUG_MODE" ]; then logg info 'The DEBUG or DEBUG_MODE environment variable is set so preliminary system tweaks will be run synchronously' + installXcode addFlathub allocateSwap configureGPG @@ -812,6 +827,7 @@ if [ -n "$DEBUG" ] || [ -n "$DEBUG_MODE" ]; then setupLinuxHomebrewFonts miscMacOs else + installXcode & addFlathub & allocateSwap & configureGPG & diff --git a/home/dot_local/bin/post-installx/executable_post-xcode.sh b/home/.chezmoiscripts_disabled/disabled/executable_post-xcode.sh similarity index 100% rename from home/dot_local/bin/post-installx/executable_post-xcode.sh rename to home/.chezmoiscripts_disabled/disabled/executable_post-xcode.sh diff --git a/home/.chezmoitemplates/darwin/Brewfile b/home/.chezmoitemplates/darwin/Brewfile index b2cdee69..b8cb372b 100644 --- a/home/.chezmoitemplates/darwin/Brewfile +++ b/home/.chezmoitemplates/darwin/Brewfile @@ -27,7 +27,9 @@ brew "gsed" brew "gum" brew "htmlq" brew "jq" +brew "mas" brew "moreutils" +brew "m4" brew "node" brew "openssh" brew "pinentry-mac" diff --git a/home/dot_local/bin/executable_installx b/home/dot_local/bin/executable_installx index e0f62031..5acd3345 100644 --- a/home/dot_local/bin/executable_installx +++ b/home/dot_local/bin/executable_installx @@ -41,7 +41,7 @@ async function runScript(key, script) { fs.writeFileSync(`${cacheDir}/${key}-glow`, (file.stdout ? `# ${file.stdout}\n\n` : '') + (brief.stdout ? `> ${brief.stdout}\n\n` : '') + '```sh\n' + templatedScript.stdout + "\n```") fs.writeFileSync(`${cacheDir}/${key}`, templatedScript.stdout) try { - runSilentCommand(`glow --width 80 "${cacheDir}/${key}-glow"`) + runSilentCommand(`glow --width 120 "${cacheDir}/${key}-glow"`) // TODO: Set process.env.DEBUG || true here because the asynchronous method is not logging properly / running slow if (process.env.DEBUG) { return await runSilentCommand(`bash "${cacheDir}/${key}" || logg error 'Error occurred while processing script for ${key}'`) diff --git a/software.yml b/software.yml index 2e57c6c6..68398d82 100644 --- a/software.yml +++ b/software.yml @@ -12047,10 +12047,10 @@ softwarePackages: _home: https://developer.apple.com/xcode/ _name: XCode _post: sudo xcodebuild -license accept && sudo xcodebuild -runFirstLaunch - script:darwin: bash "$HOME/.local/bin/post-installx/post-xcode.sh" mas: 497799835 xcodeinstall: _bin: xcodeinstall + _deprecated: The preferred method is to use mas early in the installation since Xcode might be a dependency during the full install _desc: "xcodeinstall is a tool available on GitHub at https://github.com/sebsto/xcodeinstall that simplifies the installation and management of Xcode on macOS systems. It allows users to easily download and \ninstall different versions of Xcode from the command line, which can be useful for developers who need to switch between Xcode versions for compatibility testing or other purposes. The tool provides a \nconvenient way to automate the process of managing Xcode installations on macOS systems. " _github: https://github.com/sebsto/xcodeinstall _name: Xcode Install