Skip to content

Commit

Permalink
revert bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Oct 30, 2024
1 parent 42692b2 commit 2874fa6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/example-10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
conda list
python -VV
printenv | sort
example-10-miniforge-installation-dir:
# prevent cronjobs from running on forks
if:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ jobs:
In addition to `Miniforge3` with `conda`, `mamba` and `CPython`, you can also
install `Miniforge-pypy3`, which replaces `CPython` with `PyPy.

> [!TIP]
> You can customize the installation directory via the `installation-dir` option.
> [!TIP] You can customize the installation directory via the `installation-dir`
> option.

### Example 11: Alternative Architectures

Expand Down
17 changes: 13 additions & 4 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions src/conda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,20 @@ export function condaExecutable(
);
}

/** Detect the presence of mamba */
/**
* Detect the presence of mamba
*/
export function isMambaInstalled(
inputs: types.IActionInputs,
options: types.IDynamicOptions,
) {
const mamba = condaExecutable(inputs, { ...options, useMamba: true });
return fs.existsSync(mamba);
for (const exe of condaExecutableLocations(inputs, {
...options,
useMamba: true,
})) {
if (fs.existsSync(exe)) return true;
}
return false;
}

/**
Expand All @@ -113,7 +120,11 @@ export async function condaCommand(
options: types.IDynamicOptions,
): Promise<void> {
const command = [condaExecutable(inputs, options, cmd[0]), ...cmd];
return await utils.execute(command);
let env: { [key: string]: string } = {};
if (options.useMamba) {
env.MAMBA_ROOT_PREFIX = condaBasePath(inputs, options);
}
return await utils.execute(command, env);
}

/**
Expand Down

0 comments on commit 2874fa6

Please sign in to comment.