Skip to content

Commit

Permalink
restore bash forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Oct 3, 2024
1 parent 24ed97e commit f2345f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions dist/setup/index.js

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

8 changes: 6 additions & 2 deletions src/base-tools/update-mamba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ export const updateMamba: types.IToolProvider = {
fs.symlinkSync(mambaExec, condabinLocation);
}
} else {
core.info(`Creating .bat wrapper for 'mamba 2.x'...`);
core.info(`Creating bash wrapper for 'mamba'...`);
const mambaBat = condabinLocation.slice(0, -4) + ".bat";
// Add bat-less forwarder for bash users on Windows
const forwarderContents = `cmd.exe /C CALL "${mambaBat}" $* || exit 1`;
fs.writeFileSync(condabinLocation.slice(0, -4), forwarderContents);
core.info(`... wrote ${mambaExec.slice(0, -4)}:\n${forwarderContents}`);
if (!fs.existsSync(mambaBat)) {
// This is Windows and mamba 2.x, we need a mamba.bat like 1.x used to have
const contents = `
Expand Down Expand Up @@ -69,7 +73,7 @@ export const updateMamba: types.IToolProvider = {
@IF [%1]==[uninstall] "%~dp0_conda_activate" reactivate
@EXIT /B %errorlevel%`;
core.info(`Creating BAT wrapper for 'mamba 2.x'...`);
core.info(`Creating .bat wrapper for 'mamba 2.x'...`);
fs.writeFileSync(mambaBat, contents);
core.info(`... wrote ${mambaBat}`);
}
Expand Down

0 comments on commit f2345f7

Please sign in to comment.