nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
8k stars 131 forks source link

Echo failed dependency in add-to-bin #569

Closed nickcurran closed 1 month ago

nickcurran commented 1 month ago

build-debug.sh and run-debug.sh fail silently when a dependency is missing, e.g., fish, rust, xcbeautify. This adds an output message indicating when a dependency is missing, e.g., Dependency xcbeautify not found.

nikitabobko commented 1 month ago

It's by design that it doesn't fail. All of those dependencies are optional (e.g. you only need fish if you want to build shell completion)

build-debug.sh and run-debug.sh fail silently when a dependency is missing

Are you sure? I just tried to run run-debug.sh with the following patch, and it run without problems. Maybe you mean build-release.sh?

diff --git a/script/setup.sh b/script/setup.sh
index 49bb2998..0b51f141 100644
--- a/script/setup.sh
+++ b/script/setup.sh
@@ -6,7 +6,7 @@ set -o pipefail # Any command failed in the pipe fails the whole pipe

 add-to-bin() {
     /usr/bin/which "$1" &> /dev/null && \
-        cat > ".deps/bin/${2:-$1}" <<EOF
+        /bin/cat > ".deps/bin/${2:-$1}" <<EOF
 #!/bin/bash
 exec '$(/usr/bin/which "$1")' "\$@"
 EOF
@@ -16,18 +16,18 @@ if /bin/test -z "${NUKE_PATH:-}"; then
     /bin/rm -rf .deps/bin
     /bin/mkdir -p .deps/bin

-    add-to-bin bash not-outdated-bash # build-shell-completion.sh
-    add-to-bin brew # install-from-sources.sh
-    add-to-bin bundle # Ruby, asciidoc
-    add-to-bin bundler # Ruby, asciidoc
-    add-to-bin cargo
-    add-to-bin fish
-    add-to-bin git
-    add-to-bin rustc
-    add-to-bin xcbeautify
+    # add-to-bin bash not-outdated-bash # build-shell-completion.sh
+    # add-to-bin brew # install-from-sources.sh
+    # add-to-bin bundle # Ruby, asciidoc
+    # add-to-bin bundler # Ruby, asciidoc
+    # add-to-bin cargo
+    # add-to-bin fish
+    # add-to-bin git
+    # add-to-bin rustc
+    # add-to-bin xcbeautify

     export PATH="${PWD}/.deps/bin:/bin:/usr/bin"
-    chmod +x .deps/bin/*
+    # chmod +x .deps/bin/*
     export NUKE_PATH=1
 fi
nickcurran commented 1 month ago

Yes, I'm very sure which commands I'm running that fail before my suggested changes: run-debug.sh and build-debug.sh.

Is it your intent that I comment out the dependencies that I don't intend to install? It would be easier if add-to-bin didn't fail silently - maybe don't fail at all and show a warning?