From 4f5b08eb694f9b9f66fb89762f86ce2624dbc556 Mon Sep 17 00:00:00 2001 From: Victor Franzi Date: Tue, 24 Nov 2026 16:36:27 +0100 Subject: [PATCH] Quote justfile paths so recipes work from a directory with spaces The _install-roles recipe (added in bcb862c7f) and the add-inventory-host, molecule and molecule-clean recipes interpolated justfile_directory() unquoted, so the shell split the path at the first space. just update then failed with: sh: /Users/alice/Library/Mobile: No such file or directory --- justfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/justfile b/justfile index f2d57c408..fb492f57d 100644 --- a/justfile +++ b/justfile @@ -21,7 +21,7 @@ default: # Adds a new host to the inventory, creating the inventory files if necessary (e.g. `just add-inventory-host example.com 1.2.3.4`) add-inventory-host domain server_address: - @{{ justfile_directory() }}/bin/add-inventory-host.sh {{ quote(domain) }} {{ quote(server_address) }} + @{{ quote(justfile_directory() / "bin/add-inventory-host.sh") }} {{ quote(domain) }} {{ quote(server_address) }} # Pulls external Ansible roles (--force also replaces roles with local changes) roles *flags: @@ -153,17 +153,17 @@ stop-group group *extra_args: # Runs a role's Molecule scenario locally (no argument lists the roles that have one) molecule *args: - @{{ justfile_directory() }}/bin/molecule.sh {{ args }} + @{{ quote(justfile_directory() / "bin/molecule.sh") }} {{ args }} # Removes the Molecule virtualenv and per-role Ansible homes from var/ molecule-clean *args: - @{{ justfile_directory() }}/bin/molecule-clean.sh {{ args }} + @{{ quote(justfile_directory() / "bin/molecule-clean.sh") }} {{ args }} # Internal - installs the roles in requirements.yml, keeping roles with local changes _install-roles *flags: - @{{ justfile_directory() }}/bin/ansible-python.sh {{ justfile_directory() }}/bin/install-roles.py \ - --requirements-path={{ justfile_directory() }}/requirements.yml \ - --roles-path={{ justfile_directory() }}/roles/galaxy \ + @{{ quote(justfile_directory() / "bin/ansible-python.sh") }} {{ quote(justfile_directory() / "bin/install-roles.py") }} \ + --requirements-path={{ quote(justfile_directory() / "requirements.yml") }} \ + --roles-path={{ quote(justfile_directory() / "roles/galaxy") }} \ --state-path={{ quote(installed_roles_file_path) }} \ {{ flags }}