Skip to content

Commit

Permalink
fix(binary): use COMPOSE_IGNORE_ORPHANS=1 in global binary shim
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Feb 9, 2021
1 parent 40b3cae commit 9d4a955
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ddb/feature/shell/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ def remove_binary_shim(self, shims_path: str, name: str) -> Optional[str]:

def create_binary_shim(self, shims_path: str, name: str, global_: bool):
if global_:
environment_variable = next(
ddb_project_home_variable = next(
self.set_environment_variable(config.env_prefix + "_PROJECT_HOME", config.paths.project_home)
)

compose_ignore_orphans_variable = next(
self.set_environment_variable("COMPOSE_IGNORE_ORPHANS", "1")
)

command = f"$(ddb deactivate --force)\n" \
f"{environment_variable}\n" \
f"{ddb_project_home_variable}\n" \
f"{compose_ignore_orphans_variable}\n" \
f"$(ddb activate --force)\n" \
f"$(ddb run {name} \"$@\")"
else:
Expand Down Expand Up @@ -220,6 +225,10 @@ def create_binary_shim(self, shims_path: str, name: str, global_: bool):
self.set_environment_variable(config.env_prefix + "_PROJECT_HOME", config.paths.project_home)
))

commands.append(next(
self.set_environment_variable("COMPOSE_IGNORE_ORPHANS", "1")
))

commands.extend([
"set command=(ddb activate --force)",
"%command%>cmd.txt",
Expand Down

0 comments on commit 9d4a955

Please sign in to comment.