Skip to content

Commit

Permalink
cylc version --long: ensure correct path is printed for cylc exec…
Browse files Browse the repository at this point in the history
…utable
  • Loading branch information
MetRonnie committed Jun 19, 2024
1 parent 61c1f28 commit 5b21590
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cylc/flow/scripts/cylc.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_version(long=False):
from pathlib import Path
version = f"{__version__}"
if long:
version += f" ({Path(sys.executable).parent.parent})"
version += f" ({Path(sys.argv[0])})"
return version


Expand Down
7 changes: 1 addition & 6 deletions tests/functional/cli/01-help.t
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ run_ok "${TEST_NAME_BASE}-id" cylc help id

# Check "cylc version --long" output is correct.
cylc version --long | head -n 1 > long1
WHICH="$(command -v cylc)"
PARENT1="$(dirname "${WHICH}")"
PARENT2="$(dirname "${PARENT1}")"
echo "$(cylc version) (${PARENT2})" > long2
# the concise version of the above is a bash quoting nightmare:
# echo "$(cylc version) ($(dirname $(dirname $(which cylc))))" > long2
echo "$(cylc version) ($(command -v cylc))" > long2
cmp_ok long1 long2

# --help with no DISPLAY
Expand Down

0 comments on commit 5b21590

Please sign in to comment.