Skip to content

Commit

Permalink
feat: basic support for passing cli parameters as arguments
Browse files Browse the repository at this point in the history
Example:

  setup-micromamba --micromamba-root-path micromamba debug --init-shell none --create-environment true --environment-file environment.yml --generate-run-shell true --micromamba-run-shell-path ./micromamba/run-shell --log-level debug
  • Loading branch information
thewtex committed Dec 7, 2023
1 parent 380f313 commit eb30a83
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dist/cli.js

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

8 changes: 8 additions & 0 deletions dist/index.js

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

8 changes: 8 additions & 0 deletions dist/post.js

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

8 changes: 8 additions & 0 deletions src/mocking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ export const coreMocked = {
process.exit(1)
},
getInput: (name: string) => {
const optionFlag = `--${name}`
const cliFlagIndex = process.argv.indexOf(optionFlag)
if (cliFlagIndex > -1) {
const value = process.argv[cliFlagIndex + 1]
if (typeof value === 'string') {
return value
}
}
let value = process.env[`INPUT_${name.replace(/-/g, '_').toUpperCase()}`]
if (value === undefined) {
value = process.env[`${name.replace(/-/g, '_').toUpperCase()}`]
Expand Down

0 comments on commit eb30a83

Please sign in to comment.