From 39d4c402d568c520377378e4246c198f2f07de06 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 9 Aug 2023 08:28:55 -0500 Subject: [PATCH] Fix suffix of tab completion scripts (#39154) --- lib/spack/spack/cmd/commands.py | 4 ++-- lib/spack/spack/test/cmd/commands.py | 5 +++-- .../bash/{spack-completion.in => spack-completion.bash} | 2 +- .../fish/{spack-completion.in => spack-completion.fish} | 2 +- share/spack/spack-completion.bash | 2 +- share/spack/spack-completion.fish | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) rename share/spack/bash/{spack-completion.in => spack-completion.bash} (99%) rename share/spack/fish/{spack-completion.in => spack-completion.fish} (99%) diff --git a/lib/spack/spack/cmd/commands.py b/lib/spack/spack/cmd/commands.py index a65031387db..61be25f0366 100644 --- a/lib/spack/spack/cmd/commands.py +++ b/lib/spack/spack/cmd/commands.py @@ -36,13 +36,13 @@ "bash": { "aliases": True, "format": "bash", - "header": os.path.join(spack.paths.share_path, "bash", "spack-completion.in"), + "header": os.path.join(spack.paths.share_path, "bash", "spack-completion.bash"), "update": os.path.join(spack.paths.share_path, "spack-completion.bash"), }, "fish": { "aliases": True, "format": "fish", - "header": os.path.join(spack.paths.share_path, "fish", "spack-completion.in"), + "header": os.path.join(spack.paths.share_path, "fish", "spack-completion.fish"), "update": os.path.join(spack.paths.share_path, "spack-completion.fish"), }, } diff --git a/lib/spack/spack/test/cmd/commands.py b/lib/spack/spack/test/cmd/commands.py index 7a531b4f919..5bd0e20e600 100644 --- a/lib/spack/spack/test/cmd/commands.py +++ b/lib/spack/spack/test/cmd/commands.py @@ -219,7 +219,8 @@ def test_fish_completion(): def test_update_completion_arg(shell, tmpdir, monkeypatch): """Test the update completion flag.""" - mock_infile = tmpdir.join("spack-completion.in") + tmpdir.join(shell).mkdir() + mock_infile = tmpdir.join(shell).join(f"spack-completion.{shell}") mock_outfile = tmpdir.join(f"spack-completion.{shell}") mock_args = { @@ -267,7 +268,7 @@ def test_updated_completion_scripts(shell, tmpdir): "and adding the changed files to your pull request." ) - header = os.path.join(spack.paths.share_path, shell, "spack-completion.in") + header = os.path.join(spack.paths.share_path, shell, f"spack-completion.{shell}") script = "spack-completion.{0}".format(shell) old_script = os.path.join(spack.paths.share_path, script) new_script = str(tmpdir.join(script)) diff --git a/share/spack/bash/spack-completion.in b/share/spack/bash/spack-completion.bash similarity index 99% rename from share/spack/bash/spack-completion.in rename to share/spack/bash/spack-completion.bash index 048c8656494..0d740101fa9 100755 --- a/share/spack/bash/spack-completion.in +++ b/share/spack/bash/spack-completion.bash @@ -7,7 +7,7 @@ # NOTE: spack-completion.bash is auto-generated by: # # $ spack commands --aliases --format=bash -# --header=bash/spack-completion.in --update=spack-completion.bash +# --header=bash/spack-completion.bash --update=spack-completion.bash # # Please do not manually modify this file. diff --git a/share/spack/fish/spack-completion.in b/share/spack/fish/spack-completion.fish similarity index 99% rename from share/spack/fish/spack-completion.in rename to share/spack/fish/spack-completion.fish index f08c8b1f111..ee06dade573 100644 --- a/share/spack/fish/spack-completion.in +++ b/share/spack/fish/spack-completion.fish @@ -6,7 +6,7 @@ # NOTE: spack-completion.fish is auto-generated by: # # $ spack commands --aliases --format=fish -# --header=fish/spack-completion.in --update=spack-completion.fish +# --header=fish/spack-completion.fish --update=spack-completion.fish # # Please do not manually modify this file. diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 9e184aa9a76..f504bea3906 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -7,7 +7,7 @@ # NOTE: spack-completion.bash is auto-generated by: # # $ spack commands --aliases --format=bash -# --header=bash/spack-completion.in --update=spack-completion.bash +# --header=bash/spack-completion.bash --update=spack-completion.bash # # Please do not manually modify this file. diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 9b4027dfe3b..d743cf0f52c 100755 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -6,7 +6,7 @@ # NOTE: spack-completion.fish is auto-generated by: # # $ spack commands --aliases --format=fish -# --header=fish/spack-completion.in --update=spack-completion.fish +# --header=fish/spack-completion.fish --update=spack-completion.fish # # Please do not manually modify this file.