Skip to content

Commit

Permalink
copy mamba.bat if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Nov 25, 2024
1 parent ab6bf8b commit 98c3f25
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/shell-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ const removeMambaInitBlockFromBashProfile = () => {
const copyMambaBatToMicromambaBat = (options: Options) => {
const mambaBat = path.join(options.micromambaRootPath, 'condabin', 'mamba.bat')
const micromambaBat = path.join(options.micromambaRootPath, 'condabin', 'micromamba.bat')
return fs.copyFile(mambaBat, micromambaBat)
const existsMamba = existsSync(mambaBat)
const existsMicromamba = existsSync(micromambaBat)
core.info(`mamba.bat found: ${existsMamba} - micromamba.bat found: ${existsMicromamba}`)
if (existsSync(mambaBat) && !existsSync(micromambaBat)) {
core.info(`calling the copy`)
return fs.copyFile(mambaBat, micromambaBat)
} else {
core.info(`return fulfilled promised`)
return Promise.resolve(undefined)
}
}

export const shellInit = (options: Options, shell: string) => {
Expand Down

0 comments on commit 98c3f25

Please sign in to comment.