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

Allow overwriting existing output file #168

Merged
merged 2 commits into from
Feb 6, 2021
Merged

Conversation

romanz
Copy link
Contributor

@romanz romanz commented Dec 31, 2020

Otherwise, rage fails with:

$ echo | rage -r age100qf7fggvctqclsqvl2xu6vjnrerxm9vt8x56yql6gaz9x54vcaqdh2q26 -o existing-file.age
Error: File exists (os error 17)

@codecov
Copy link

codecov bot commented Dec 31, 2020

Codecov Report

Merging #168 (3e282b4) into main (9c56470) will increase coverage by 1.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   34.90%   36.21%   +1.31%     
==========================================
  Files          33       33              
  Lines        2716     2764      +48     
==========================================
+ Hits          948     1001      +53     
+ Misses       1768     1763       -5     
Impacted Files Coverage Δ
age/src/cli_common/file_io.rs 14.58% <100.00%> (+14.58%) ⬆️
age/src/protocol/decryptor.rs 45.16% <0.00%> (-1.72%) ⬇️
age-core/src/format.rs 75.00% <0.00%> (-1.67%) ⬇️
age/src/primitives/armor.rs 41.79% <0.00%> (-0.88%) ⬇️
age-core/src/plugin.rs 32.67% <0.00%> (-0.66%) ⬇️
age/src/i18n.rs 0.00% <0.00%> (ø)
age/src/scrypt.rs 48.97% <0.00%> (ø)
age/src/identity.rs 53.96% <0.00%> (+0.84%) ⬆️
age/src/format.rs 56.09% <0.00%> (+1.21%) ⬆️
age/src/ssh.rs 32.50% <0.00%> (+1.25%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c56470...3e282b4. Read the comment docs.

@romanz
Copy link
Contributor Author

romanz commented Jan 15, 2021

IIUC, all the tests pass except uploading benchmarks - which fails with:

Must provide CRITERION_TOKEN in environment: export CRITERION_TOKEN="token"
Error: Process completed with exit code 1.

https://github.com/str4d/rage/pull/168/checks?check_run_id=1708942847

@romanz
Copy link
Contributor Author

romanz commented Jan 20, 2021

Ping :)

Base automatically changed from master to main January 30, 2021 14:34
Copy link
Owner

@str4d str4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I've been reluctant to merge it because I'm not personally a fan of just overwriting files, but after talking with @FiloSottile and some other sysadmins, I now agree that the more consistent UX is for -o to behave the same way as pipes, i.e. do what Unix does and overwrite the output.

age/src/cli_common/file_io.rs Outdated Show resolved Hide resolved
@str4d str4d merged commit db7f6c3 into str4d:main Feb 6, 2021
@romanz
Copy link
Contributor Author

romanz commented Feb 6, 2021

Thanks!

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