Skip to content

Commit

Permalink
Fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag committed Jun 27, 2022
1 parent 3ecd35d commit b587a72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions dist/main/index.js

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

10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PATHS = {
bashrc: path.join(os.homedir(), '.bashrc'),
bashrcBak: path.join(os.homedir(), '.bashrc.actionbak'),
micromambaBinFolder: path.join(os.homedir(), 'micromamba-bin'),
micromambaExe: path.join(os.homedir(), 'micromamba-bin', process.platform === 'win' ? 'micromamba.exe' : 'micromamba'),
micromambaExe: path.join(os.homedir(), 'micromamba-bin', process.platform === 'win32' ? 'micromamba.exe' : 'micromamba'),
micromambaRoot: path.join(os.homedir(), 'micromamba'),
micromambaPkgs: path.join(os.homedir(), 'micromamba', 'pkgs'),
micromambaEnvs: path.join(os.homedir(), 'micromamba', 'envs')
Expand All @@ -30,7 +30,7 @@ function getCondaArch () {
[['osx', 'x64']]: 'osx-64',
[['linux', 'x64']]: 'linux-64',
[['linux', 'arm64']]: 'linux-aarch64',
[['win', 'x64']]: 'win-64'
[['win32', 'x64']]: 'win-64'
}[[process.platform, process.arch]]
if (!arch) {
throw Error(`Platform ${process.platform}/${process.arch} not supported.`)
Expand Down Expand Up @@ -67,7 +67,7 @@ function executePwsh (command) {
return executeShell('powershell', '-command', `${command}; exit $LASTEXITCODE`)
}

const executeLoginShell = process.platform === 'win' ? executePwsh : executeBashLogin
const executeLoginShell = process.platform === 'win32' ? executePwsh : executeBashLogin

function micromambaCmd (command, logLevel, micromambaExe = 'micromamba') {
return `${micromambaExe} ${command}` + (logLevel ? ` --log-level ${logLevel}` : '')
Expand Down Expand Up @@ -294,7 +294,7 @@ async function createOrUpdateEnv (envName, envFilePath, extraSpecs, logLevel) {
if (envFilePath) {
cmd += ' -f ' + envFilePath
}
if (process.platform === 'win') {
if (process.platform === 'win32') {
await executePwsh(cmd)
} else {
await executeBash(cmd)
Expand Down Expand Up @@ -365,7 +365,7 @@ async function installEnvironment (inputs, envFilePath, envYaml) {

// Add micromamba activate to profile
const autoactivateCmd = `micromamba activate ${envName};`
if (process.platform === 'win') {
if (process.platform === 'win32') {
const powershellAutoActivateEnv = `if (!(Test-Path $profile))
{
New-Item -path $profile -type "file" -value "${autoactivateCmd}"
Expand Down

0 comments on commit b587a72

Please sign in to comment.