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

Switch extractZipNix to use the -n #554

Closed
wants to merge 2 commits into from
Closed

Switch extractZipNix to use the -n #554

wants to merge 2 commits into from

Conversation

Arzte
Copy link

@Arzte Arzte commented Aug 11, 2020

Without expressing a preference on whether to overwrite a file or not, unzip, by default, will prompt for user input on what it should do. Causing any CI actions that use this function to timeout, which is undesirable.

This causes issues in actions upstream such as actions-rs/install#6

There is only two ways to change unzip's default and that is with -n and -o respectively, -n would probably be the preferred default, as otherwise, files may be unintentionally overwritten.


Another approach to solving this problem would be to allow callers of extractZip to specify how they want to treat existing files, however that would require a change to the functions signature, as well as making more difficult to maintain two different platform behaviors.

(extract on what the options do from the unzip man page)

-n

never overwrite existing files. If a file already exists, skip the extraction of that file without prompting. By default unzip queries before extracting any file that already exists; the user may choose to overwrite only the current file, overwrite all files, skip extraction of the current file, skip extraction of all existing files, or rename the current file.
-o

overwrite existing files without prompting. This is a dangerous option, so use it with care. (It is often used with -f, however, and is the only way to overwrite directory EAs under OS/2.) 

Without expressing a preference on whether to overwrite a file or not, unzip, by default, will prompt for user input on what it should do. Causing any CI actions that use this function to timeout, which is undesirable.

This causes issues in actions upstream such as actions-rs/install#6
@Arzte Arzte changed the title Switch extractZipNix to use the -n prompt Switch extractZipNix to use the -n Aug 11, 2020
This fixes the unzip tests
@thboop
Copy link
Collaborator

thboop commented May 19, 2021

Closing in favor of #807

@thboop thboop closed this May 19, 2021
@Arzte Arzte deleted the patch-1 branch June 21, 2022 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants