From 26ccc9d149a77a75af3553261d954feb88203e2f Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Sun, 25 Dec 2022 12:07:02 +0000 Subject: [PATCH] Update 2 files - /home/dot_local/bin/executable_install-program - /home/private_dot_config/shell/exports.sh.tmpl --- home/dot_local/bin/executable_install-program | 18 +++++++++++------- home/private_dot_config/shell/exports.sh.tmpl | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index d3d66326..dbfe6604 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -736,7 +736,7 @@ async function ensurePackageManager(packageManager) { ) } else if (packageManager === 'brew' || packageManager === 'cask') { const brew = which.sync('brew', { nothrow: true }) - if (!brew && false) { + if (!brew) { await ensureInstalled( 'brew', $` @@ -762,12 +762,16 @@ async function ensurePackageManager(packageManager) { ) } } else if (packageManager === 'cargo') { - await ensureInstalled( - 'cargo', - $` - # TODO Bash script that installs cargo - ` - ) + const cargo = which.sync('cargo', { nothrow: true }) + if (!cargo) { + if (osType === 'darwin') { + await $`brew install rustup` + await $`rustup-init` + } else if (osType === 'windows') { + } else { + await ensurePackage('cargo') + } + } } else if (packageManager === 'choco') { await ensureInstalled( 'choco', diff --git a/home/private_dot_config/shell/exports.sh.tmpl b/home/private_dot_config/shell/exports.sh.tmpl index bf5ab6d9..9a84c363 100644 --- a/home/private_dot_config/shell/exports.sh.tmpl +++ b/home/private_dot_config/shell/exports.sh.tmpl @@ -119,9 +119,10 @@ export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" export MACHINE_STORAGE_PATH="$XDG_DATA_HOME/docker-machine" ### Dotnet -# TODO - Add DOTNET_ROOT for Linuxbrew if [ -d /Applications ] && [ -d /Library ]; then export DOTNET_ROOT="/usr/local/opt/dotnet/libexec" +elif [ -d /home/linuxbrew/.linuxbrew/opt/dotnet ]; then + export DOTNET_ROOT="/home/linuxbrew/.linuxbrew/opt/dotnet/libexec" fi ### Elastic Agent