Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add delete (when files deleted in Explorer) #110

Merged
merged 2 commits into from Feb 16, 2017
Merged

Conversation

jeffyoung
Copy link
Contributor

Also update telemetry (we don't want to send any on file operations)
Miscellaneous clean up

Also update telemetry (we don't want to send any on file operations)
Miscellaneous clean up
let lines: string[] = CommandHelper.SplitIntoLines(executionResult.stdout, false, true /*filterEmptyLines*/);

if (executionResult.exitCode === 100) {
CommandHelper.ProcessErrors(this.GetArguments().GetCommand(), executionResult, true);
Copy link
Member

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.

return {};
}

//Delete returns either 0 (success) or 100 (failure). IF we fail, simply throw.
Copy link
Member

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.

Copy link
Member

@jpricket jpricket left a 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)) {
Copy link
Member

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.

Copy link
Contributor Author

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
@jeffyoung jeffyoung merged commit 356dfc8 into master Feb 16, 2017
@jeffyoung jeffyoung deleted the jeyou/delete-operation branch February 16, 2017 16:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants