Skip to content

Commit

Permalink
Ensure injections are in a injection folder
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Oct 11, 2023
1 parent 26847a6 commit f3e1698
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions binharness/types/injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from typing import TYPE_CHECKING

from binharness.util import generate_random_suffix

if TYPE_CHECKING:
from pathlib import Path

Expand Down Expand Up @@ -46,10 +48,12 @@ def install(self: Injection, environment: Environment) -> None:
raise InjectionAlreadyInstalledError
if self.env_path is None:
self.env_path = environment.get_tempdir() / (
self.__class__.__name__ + ".bh-inj"
f"{self.host_path.name}-{generate_random_suffix()}.bh-inj"
)

environment.inject_files([(self.host_path, self.env_path)])
environment.inject_files(
[(self.host_path, self.env_path / self.host_path.name)]
)
self._environment = environment

def is_installed(self: Injection) -> bool:
Expand Down

0 comments on commit f3e1698

Please sign in to comment.