Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag committed May 12, 2022
1 parent e36c711 commit d6bb4b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
20 changes: 12 additions & 8 deletions dist/main/index.js

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

20 changes: 12 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,16 @@ channel_priority: strict
}

async function installEnvironment (inputs, envFilePath, envYaml) {
core.warning([envFilePath, inputs.extraSpecs])
if (!envFilePath && !inputs.extraSpecs) {
// Nothing to install
return
}

// Determine environment name
let envName
if (inputs.envFile === 'false') {
if (inputs.envName) {
envName = inputs.envName
} else {
throw Error("Must provide 'environment-name' for 'environment-file: false'")
}
} else {
if (envFilePath) {
// Have environment.yml or .lock file
if (envYaml) {
if (inputs.envName) {
envName = inputs.envName
Expand All @@ -287,13 +283,21 @@ async function installEnvironment (inputs, envFilePath, envYaml) {
throw Error("Must provide 'environment-name' if environment.yml doesn't provide a 'name' attribute")
}
}
} else { // .lock file
} else {
// .lock file
if (inputs.envName) {
envName = inputs.envName
} else {
throw Error("Must provide 'environment-name' for .lock files")
}
}
} else {
// Have extra-specs only
if (inputs.envName) {
envName = inputs.envName
} else {
throw Error("Must provide 'environment-name' for 'environment-file: false'")
}
}

// Install env
Expand Down

0 comments on commit d6bb4b0

Please sign in to comment.