Skip to content
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

Improve no readme error message #116

Merged
merged 4 commits into from
Feb 6, 2023
Merged

Conversation

mxsdev
Copy link
Contributor

@mxsdev mxsdev commented Feb 3, 2023

Solves #108

Error is now formatted like:

readme file does not exist: ./cmd/README.md

@mxsdev mxsdev changed the title improve no readme error message Improve no readme error message Feb 4, 2023
internal/cmd/common.go Outdated Show resolved Hide resolved
@adambabik
Copy link
Collaborator

Also, we can add an integration test:

--- a/testdata/script/basic.txtar
+++ b/testdata/script/basic.txtar
@@ -6,6 +6,10 @@ exec runme ls --allow-unknown
 cmp stdout golden-list-allow-unknown.txt
 ! stderr .
 
+! exec runme ls --filename nonexistent.md
+stderr 'failed to open markdown file .*/nonexistent.md: no such file or directory'
+! stdout .

You can execute it like this:

go test -timeout 10s -run ^TestRunme$ .

@mxsdev
Copy link
Contributor Author

mxsdev commented Feb 4, 2023

@adambabik Done!

internal/cmd/common.go Outdated Show resolved Hide resolved
@adambabik adambabik merged commit d666328 into stateful:main Feb 6, 2023
@mxsdev mxsdev linked an issue Feb 6, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message when no README.md is present
2 participants