diff --git a/bash.d/10-no-ms-spying.sh b/bash.d/10-no-ms-spying.sh index 6d7f94a..4ff06dd 100644 --- a/bash.d/10-no-ms-spying.sh +++ b/bash.d/10-no-ms-spying.sh @@ -1 +1,2 @@ +#!/bin/bash export DOTNET_CLI_TELEMETRY_OPTOUT=1 diff --git a/bash.d/90-prompt.sh b/bash.d/90-prompt.sh index d4163b5..b28a974 100644 --- a/bash.d/90-prompt.sh +++ b/bash.d/90-prompt.sh @@ -1,5 +1,5 @@ #!/bin/bash -if test -x starship; then +if command -v starship > /dev/null; then eval "$(starship init bash)" fi diff --git a/setup.d/01-brew.sh b/setup.d/01-brew.sh new file mode 100644 index 0000000..955a9f7 --- /dev/null +++ b/setup.d/01-brew.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ "$OSTYPE" == "darwin"* ]]; then + if ! command -v brew > /dev/null; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + fi +fi diff --git a/setup.d/10-reattach-to-user-namespace.sh b/setup.d/10-reattach-to-user-namespace.sh new file mode 100644 index 0000000..055677b --- /dev/null +++ b/setup.d/10-reattach-to-user-namespace.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ "$OSTYPE" == "darwin"* ]]; then + if ! command -v reattach-to-user-namespace > /dev/null; then + brew install reattach-to-user-namespace + fi +fi diff --git a/setup.d/10-shellcheck.sh b/setup.d/10-shellcheck.sh index 3dd3eb3..78c4aa1 100755 --- a/setup.d/10-shellcheck.sh +++ b/setup.d/10-shellcheck.sh @@ -1,6 +1,18 @@ #!/bin/bash if ! command -v shellcheck > /dev/null; then - sudo apt update > /dev/null && sudo apt install shellcheck > /dev/null; - echo "Installed Shellcheck" + did_install=0 + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + sudo apt update > /dev/null && sudo apt install shellcheck > /dev/null; + did_install=1 + elif [[ "$OSTYPE" == "darwin"* ]]; then + brew install shellcheck + did_install=1 + fi + + if [[ "$did_install" == 1 ]]; then + echo "Installed Shellcheck" + else + echo "Did NOT install Shellcheck" + fi fi diff --git a/setup.d/10-starship.sh b/setup.d/10-starship.sh index 3abb2e6..6ee3fbe 100755 --- a/setup.d/10-starship.sh +++ b/setup.d/10-starship.sh @@ -1,9 +1,5 @@ #!/bin/bash -if ! test -x /usr/local/bin/starship; then +if ! command -v /usr/local/bin/starship > /dev/null; then curl -fsSL https://starship.rs/install.sh | bash fi - -if ! grep starship ~/.bashrc > /dev/null; then - echo "eval \"\$(starship init bash)\"" >> ~/.bashrc -fi