Skip to content

Commit

Permalink
Fix double spaces leading to incorrect behavior (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Sep 4, 2023
1 parent 6c568ec commit 2b72821
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,33 @@ jobs:
python --version | grep -q "Python 3.10.1"
# micromamba-shell uses the environment-name inferred by setup-micromamba
shell: micromamba-shell {0}
create-args-multiple-spaces-1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
environment-name: test
create-args: python pytest
- run: |
micromamba list | grep -q python
micromamba list | grep -q pytest
shell: bash -el {0}
create-args-multiple-spaces-2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
environment-file: test/environment2.yml
create-args: -c bioconda pytest
- run: |
micromamba list | grep -q python
micromamba list | grep -q pytest
shell: bash -el {0}
output-environment-path-env-file:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/post.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-micromamba",
"version": "1.4.3",
"version": "1.4.4",
"private": true,
"description": "Action to setup micromamba",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ const parseOrUndefinedList = <T>(key: string, schema: z.ZodSchema<T>): T[] | und
if (input === '') {
return undefined
}
return input.split(' ').map((s) => schema.parse(s))
return input
.split(' ')
.map((s) => schema.parse(s))
.filter((s) => s !== '')
}

const inferOptions = (inputs: Inputs): Options => {
Expand Down

0 comments on commit 2b72821

Please sign in to comment.