Add delete (when files deleted in Explorer) #110
Conversation
Also update telemetry (we don't want to send any on file operations) Miscellaneous clean up
src/tfvc/commands/delete.ts
Outdated
let lines: string[] = CommandHelper.SplitIntoLines(executionResult.stdout, false, true /*filterEmptyLines*/); | ||
|
||
if (executionResult.exitCode === 100) { | ||
CommandHelper.ProcessErrors(this.GetArguments().GetCommand(), executionResult, 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.
Seems like this should come first. No need to split the lines if this throws. The exit code check also seems unnecessary if you only expect 100 or 0.
src/tfvc/commands/delete.ts
Outdated
return {}; | ||
} | ||
|
||
//Delete returns either 0 (success) or 100 (failure). IF we fail, simply throw. |
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.
some example output would be helpful for understanding the parsing.
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.
small comments, but no show stoppers!
I'm lovin' it!
let deleteCandidatePaths: string[] = []; | ||
for (let index: number = 0; index < changes.length; index++) { | ||
let change: IPendingChange = changes[index]; | ||
if (change.isCandidate && GetStatuses(change.changeType).find((e) => e === Status.DELETE)) { |
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.
You can use change.HasStatus(Status.DELETE) here. I think it does the same thing.
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.
I need a Resource first (and don't have one at this point). Instead of creating one, I'll do this instead.
Adding sample output Moving error checking to start of function
Also update telemetry (we don't want to send any on file operations)
Miscellaneous clean up