Browse Source

x: extend so `x --root` returns the root of the workspace

Signed-off-by: Alejandro Mery <amery@geeks.cl>
master
Alejandro Mery 3 years ago
parent
commit
b676318ae3
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      files/bin/x

+ 12
- 1
files/bin/x

@ -58,7 +58,18 @@ find_run_sh() {
}
run_sh="$(find_run_sh)"
if [ -x "$run_sh" ]; then
if test "x--root" = "x${1:-}"; then
if [ -x "$run_sh" ]; then
# found
echo "$(dirname "$run_sh")"
exit 0
fi
# failed to find workspace
exit 1
elif [ -x "$run_sh" ]; then
exec "$run_sh" "$@"
elif [ "$#" -gt 0 ]; then
exec "$@"

Loading…
Cancel
Save