This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: enable tests on charmcraft package (#36)
- Loading branch information
Showing
5 changed files
with
71 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/craft_parts/executor/step_handler.py b/craft_parts/executor/step_handler.py | ||
index 404df69..60e5aba 100644 | ||
--- a/craft_parts/executor/step_handler.py | ||
+++ b/craft_parts/executor/step_handler.py | ||
@@ -394,7 +394,8 @@ def _create_and_run_script( | ||
) -> None: | ||
"""Create a script with step-specific commands and execute it.""" | ||
with script_path.open("w") as run_file: | ||
- print("#!/bin/bash", file=run_file) | ||
+ import shutil | ||
+ print(f"#!{shutil.which('bash')}", file=run_file) | ||
print("set -euo pipefail", file=run_file) | ||
|
||
if build_environment_script_path: | ||
diff --git a/craft_parts/plugins/validator.py b/craft_parts/plugins/validator.py | ||
index b8d8f11..fce0e72 100644 | ||
--- a/craft_parts/plugins/validator.py | ||
+++ b/craft_parts/plugins/validator.py | ||
@@ -142,9 +142,9 @@ class PluginEnvironmentValidator: | ||
print(self._env, file=env_file) | ||
print(cmd, file=env_file) | ||
env_file.flush() | ||
- | ||
+ import shutil | ||
proc = subprocess.run( | ||
- ["/bin/bash", env_file.name], | ||
+ [shutil.which("bash"), env_file.name], | ||
check=True, | ||
capture_output=True, | ||
text=True, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters