Repository navigation
fix(task): improve error message when task files are not executable #8705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
33ae563
fix(task): improve error message when task files are not executable
jdx 6526c3f
refactor(task): simplify non-executable file iterator chain
jdx 2422f4d
[autofix.ci] apply automated fixes
autofix-ci[bot] 2523b69
fix(task): skip hidden files and fix false warning on filtered tasks
jdx a363a40
fix(task): allow hidden root dirs like .mise-tasks in non-exec scan
jdx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Test that non-executable files in mise-tasks/ give a helpful error message | ||
| # Issue: https://github.com/jdx/mise/discussions/8614 | ||
|
|
||
| # Create a mise-tasks directory with non-executable files | ||
| mkdir -p mise-tasks | ||
| cat <<'EOF' >mise-tasks/build | ||
| #!/usr/bin/env bash | ||
| echo "building" | ||
| EOF | ||
| cat <<'EOF' >mise-tasks/test | ||
| #!/usr/bin/env bash | ||
| echo "testing" | ||
| EOF | ||
|
|
||
| # Ensure files are NOT executable | ||
| chmod -x mise-tasks/build mise-tasks/test | ||
|
|
||
| # Create a minimal mise.toml so the directory is recognized as a project | ||
| cat <<EOF >mise.toml | ||
| EOF | ||
|
|
||
| # Running a task should give a helpful error mentioning non-executable files | ||
| assert_fail_contains "mise run build" "non-executable" | ||
| assert_fail_contains "mise run build" "chmod +x" | ||
|
|
||
| # mise tasks ls should warn about non-executable files | ||
| assert_contains "mise tasks 2>&1" "non-executable" | ||
|
|
||
| # After making files executable, tasks should work | ||
| chmod +x mise-tasks/build mise-tasks/test | ||
| assert_contains "mise tasks" "build" | ||
| assert_contains "mise tasks" "test" | ||
| assert "mise run build" "building" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.