Skip to content

Added ability to use tilde as home dir in config for cloning repos#32222

Merged
joaomoreno merged 1 commit intomasterfrom
unknown repository
Nov 10, 2017
Merged

Added ability to use tilde as home dir in config for cloning repos#32222
joaomoreno merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Aug 10, 2017

Previously, when a user set the default location, in their config, for a repo to be cloned and they used a ~, cloning a repo would fail because VSCode did not know how to handle the ~. This PR fixes that.

@ghost
Copy link
Author

ghost commented Aug 10, 2017

@joaomoreno Any idea what the error in Travis is? Doesn't seem like it has to do with my code.

@joaomoreno
Copy link
Member

It's unrelated. Closing and opening PR to resubmit build.

const value = config.get<string>('defaultCloneDirectory') || os.homedir();
let value;
const userInputtedDirectory = config.get<string>('defaultCloneDirectory');
if (userInputtedDirectory !== undefined && userInputtedDirectory.match(/^~/)) {
Copy link

Choose a reason for hiding this comment

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

Why not use if (userInputtedDirectory && userInputtedDirectory.match(/^~/)) {?

Copy link
Author

Choose a reason for hiding this comment

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

@jcperez I could have written it that way and it would have worked, but I am being more explicit with the code I write these days.

@microsoft microsoft deleted a comment from msftclas Sep 26, 2017
@microsoft microsoft deleted a comment from msftclas Sep 26, 2017
@joaomoreno joaomoreno merged commit 56539e2 into microsoft:master Nov 10, 2017
@joaomoreno
Copy link
Member

Thanks! 🍻

@joaomoreno joaomoreno modified the milestones: Backlog, November 2017 Nov 10, 2017
@joaomoreno joaomoreno added feature-request Request for new features or functionality git GIT issues labels Nov 10, 2017
@joaomoreno joaomoreno added the verification-needed Verification of issue is requested label Dec 5, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature-request Request for new features or functionality git GIT issues verification-needed Verification of issue is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants