Skip to content

Commit

Permalink
fix: Conditionally copy script
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
  • Loading branch information
jjerphan committed Nov 25, 2024
1 parent ab6bf8b commit b76ff59
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/shell-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ 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)

if (existsSync(mambaBat) && !existsSync(micromambaBat)) {
core.info('Copying mamba.bat to micromamba.bat (compatibility with mamba 2.0.2, 2.0.3 and 2.0.4)')
return fs.copyFile(mambaBat, micromambaBat)
} else {
core.info('Not copying mamba.bat to micromamba.bat because it already exists')
}
}

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

0 comments on commit b76ff59

Please sign in to comment.