Skip to content

Commit

Permalink
Check in default location if pixi not found (#41) (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Zwerschke <[email protected]>
  • Loading branch information
leroyvn and pavelzw authored Oct 13, 2024
1 parent 41fb0be commit 66e0a0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions conda
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ def conda_run(args):
pixi_run_args = [f'"{arg}"' for arg in args[3:] if arg != "--no-capture-output"]
else:
pixi_run_args = [arg for arg in args[3:] if arg != "--no-capture-output"]
os.execlp(
"pixi",
"pixi",
"run",
*std_pixi_args(),
*pixi_env_cli_params(env),
*pixi_run_args,
)

cmd = ["pixi", "run", *std_pixi_args(), *pixi_env_cli_params(env), *pixi_run_args]
try:
os.execlp("pixi", *cmd)
except FileNotFoundError as e:
# if pixi is not on PATH, try to run it from the default location
# see https://pixi.sh/install.sh or https://pixi.sh/install.ps1
try:
os.execlp(str(DEFAULT_PIXI_EXECUTABLE_PATH), *cmd)
except FileNotFoundError:
msg = "pixi not found. Is it installed in your PATH?"
raise FileNotFoundError(msg) from e


def main(args):
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pixi-pycharm"
version = "0.0.7"
version = "0.0.8"
description = "Conda shim for PyCharm that proxies pixi"
authors = ["Pavel Zwerschke <[email protected]>"]
channels = ["conda-forge"]
Expand Down

0 comments on commit 66e0a0a

Please sign in to comment.