Skip to content

Commit

Permalink
use formatting for ref parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
charsov committed Oct 17, 2024
1 parent 6dfdb50 commit fcbbfdd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ndev/services/packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,12 @@ def copy_repo_sources(self):
requirement_line = next((l for l in self._get_requirements_txt_list() if f"{package_name_dep}==" in l))
requirement_spec = requirement_line.split(";")[0].strip()
package_version = requirement_spec.split("==")[1]
repo_ref = f"{package_name}-{package_version}"
repo_ref = repo_ref.replace("$NAME$", package_name)
repo_ref = repo_ref.replace("$VERSION$", package_version)

if "$" in repo_ref:
self.out(f"Failed to define branch {copy_item.ref}.")
return os.EX_NOINPUT

with tempfile.TemporaryDirectory() as tmp_dir:
result = subprocess.run(
Expand Down

0 comments on commit fcbbfdd

Please sign in to comment.