Skip to content

Conversation

@marco-m
Copy link

@marco-m marco-m commented Feb 12, 2024

Hello, thanks for Dasel!

I stumbled upon this minor enhancement to a diagnostic message, so I went away with the PR without opening an issue before.

Assume a read-only file:

touch foo.json
chmod 400 foo.json

and the Dasel invocation:

dasel put -f foo.json -r json -t string -v Frank 'name.first'

Before this commit, we would get:

Error: could not open file: foo.json: open foo.json: permission denied

leaving the user confused.

Now instead we would get:

Error: could not open file for writing: foo.json: open foo.json: permission denied
                           ^^^^^^^^^^^

helping the user to understand what is happening.

…iting

Assume a read-only file:

    touch foo.json
    chmod 400 foo.json

and the Dasel invocation:

    dasel put -f foo.json -r json -t string -v Frank 'name.first'

Before this commit, we would get:

    Error: could not open file: foo.json: open foo.json: permission denied

leaving the user confused.

Now instead we would get:

    Error: could not open file for writing: foo.json: open foo.json: permission denied
                               ^^^^^^^^^^^

helping the user to understand what is happening.
@TomWright
Copy link
Owner

Thanks for the suggestion @marco-m , this is now in the development version and will go out in the next release.

@TomWright
Copy link
Owner

Hey @marco-m, I thought this was an issue 😵‍💫 Sorry I didn't base off of your PR

@marco-m
Copy link
Author

marco-m commented Feb 13, 2024

@TomWright

Hey @marco-m, I thought this was an issue 😵‍💫 Sorry I didn't base off of your PR

Don't worry, I always wondered why GitHub had the same numbering for both PRs and issues, this can happen :-)

Happy that the idea has been accepted.

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.

2 participants