Skip to content

display warning about existing folder before cloning - #2863

Merged
joshaber merged 2 commits into
masterfrom
no-warning-about-existing-folder
Sep 25, 2017
Merged

joshaber merged 2 commits into
masterfrom
no-warning-about-existing-folder

Conversation

@shiftkey

Copy link
Copy Markdown
Member

Fixes #2777
Fixes #2830

The root cause of both of these problems is tucked away in doesPathExist:

  private async doesPathExist(path: string) {
    const exists = await pathExists(path)
    // If the path changed while we were checking, we don't care anymore.
    if (this.state.path !== path) {
      return
    }

    return exists
  }

You need to set this.state.path before invoking this, otherwise the result is thrown away, and whenever we were modifying the clone URL or alias we weren't - so it never did this check.

This consolidates the checks to make it harder for future contributors to not make the same mistake.

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 25, 2017
@joshaber joshaber self-assigned this Sep 25, 2017

@joshaber joshaber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch 🎡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants