-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ExtractFiles can overwrite destination folder #11594
Conversation
Thanks for taking the time to add a fix! Please see the discussion here. Let's add an environment variable that can be used to disable the feature if need be. |
@stephenmichaelf Sorry, I didn't see the previous PR. |
@@ -10,6 +10,9 @@ var cleanDestinationFolder: boolean = tl.getBoolInput('cleanDestinationFolder', | |||
var repoRoot: string = tl.getVariable('System.DefaultWorkingDirectory'); | |||
tl.debug('repoRoot: ' + repoRoot); | |||
|
|||
var overwriteDestinationVar: string = tl.getVariable('ExtractFile.OverwriteDestination'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call this something like EXTRACT_FILES_PREVENT_FILE_OVERWRITE
. The naming you are using is for another type of variable.
@@ -10,6 +10,9 @@ var cleanDestinationFolder: boolean = tl.getBoolInput('cleanDestinationFolder', | |||
var repoRoot: string = tl.getVariable('System.DefaultWorkingDirectory'); | |||
tl.debug('repoRoot: ' + repoRoot); | |||
|
|||
var overwriteDestinationVar: string = tl.getVariable('ExtractFile.OverwriteDestination'); | |||
var overwriteDestination: boolean = overwriteDestinationVar ? overwriteDestinationVar.toLowerCase() === 'true' : true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this the opposite, let's default it to overwriting and only if the variable is set then we prevent it. This lets users opt-out if they want to but all other users get the overwriting.
@stephenmichaelf -- Stephen, please review these changes, per azure-devops-docs issue 8029. If you'd like, I could then re-create this PR for the current base branch. |
This PR is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the PR otherwise this will be closed in 5 days |
@stephenmichaelf -- Stephen, per the GitHub nag message above, please let me know if this PR needs to be recreated, or if your #12902 sufficiently addresses #11593, or if that original issue is no longer relevant. Thanks! |
Hi @WilliamAntonRohm could you please check if it works for you now? We already added support for overwriting of existing files and changes have been rolled out. |
Closing this at the moment since we have rolled out fix for original issue. |
Fixes #11593