Skip to content

prompt the user to install Git if not on PATH - #1143

Merged
niik merged 17 commits into
masterfrom
do-we-have-a-git
Apr 20, 2017
Merged

niik merged 17 commits into
masterfrom
do-we-have-a-git

Conversation

@shiftkey

@shiftkey shiftkey commented Apr 6, 2017 •

Copy link
Copy Markdown
Member

Fixes #813

  • tidy up dialog layout and make it pretty
  • tidy up words and command names
  • confirm exit codes for Windows and macOS are correct
  • add some help.github.com URL to use as a placeholder
  • drop macOS lookups because It's Not Worth It™

@shiftkey shiftkey changed the title [WIP] prompt the user to install Git if not on PATH prompt the user to install Git if not on PATH Apr 6, 2017
@shiftkey

shiftkey commented Apr 6, 2017

Copy link
Copy Markdown
Member Author

Opening this up for feedback - the original issue doesn't mention an intermediate step but I think this is a bit more friendly to the end user.

@iAmWillShepherd

iAmWillShepherd commented Apr 6, 2017 •

Copy link
Copy Markdown
Contributor

This is minor, but I think we should re-phrase

It looks like you don't have Git in your PATH.

to

We were unable to locate Git in your PATH.
or

We could not locate Git on your system

private onExternalLink = () => {
// TODO: update this URL once the docs team has a better resource to reference
const platform = __DARWIN__ ? 'mac' : 'windows'
const url = `https://help.github.com/articles/set-up-git/#platform-${platform}`

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@joshaber

joshaber commented Apr 6, 2017

Copy link
Copy Markdown
Contributor

@niik @iAmWillShepherd Could one of you folks with more Windows experience review this?

Comment thread app/src/lib/open-shell.ts
// `where` will return 0 when the executable
// is found under PATH, or 1 if it cannot be found
process.on('close', function (code) {
resolve(code === 0)

This comment was marked as spam.

Comment thread app/src/ui/install-git/install.tsx Outdated
<Dialog
id='install-git'
type='warning'
title={__DARWIN__ ? 'Open in Terminal' : 'Op&en command prompt'}

This comment was marked as spam.

@joshaber

joshaber commented Apr 7, 2017 •

Copy link
Copy Markdown
Contributor

Oh I totally didn't realize you did the work for macOS too 😅 Clearly I should have actually looked at the code.

So macOS already takes care of this for us. A shim is installed by default so that if you try to run git in your Terminal and it's not installed, it'll prompt you to install it via the dev tools.

@shiftkey

shiftkey commented Apr 9, 2017

Copy link
Copy Markdown
Member Author

A shim is installed by default so that if you try to run git in your Terminal and it's not installed, it'll prompt you to install it via the dev tools.

@joshaber that answers my question about whether it's worth testing by invoking and validating that I get a reasonable output by git --version :trollface:.

@shiftkey

shiftkey commented Apr 9, 2017

Copy link
Copy Markdown
Member Author

So macOS already takes care of this for us.

So you think even bothering to check PATH here is too much work?

@joshaber

joshaber commented Apr 10, 2017 •

Copy link
Copy Markdown
Contributor

So you think even bothering to check PATH here is too much work?

Yup, combined with a Complication that macOS GUI apps don't inherit the shell environment means it'd be complex to get it right and wouldn't really provide any additional value. We can revisit if users complain, but we do nothing in Desktop Classic Mac currently.

@shiftkey

Copy link
Copy Markdown
Member Author

🍎

@shiftkey

Copy link
Copy Markdown
Member Author

Friendly bump on this before it gets consumed by merge conflicts.

Comment thread app/src/ui/install-git/install.tsx Outdated
onDismissed={this.props.onDismissed}>
<DialogContent>
<p>
We were unable to locate Git on your system. This means the shell won't be able to execute any Git commands.

This comment was marked as spam.

Comment thread app/src/ui/install-git/install.tsx Outdated
We were unable to locate Git on your system. This means the shell won't be able to execute any Git commands.
</p>
<p>
Click <strong>More information</strong> to learn how to install and add Git to your shell for your operating system.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

private onExternalLink = () => {
// TODO: update this URL once the docs team has a better resource to reference
const platform = __DARWIN__ ? 'mac' : 'windows'
const url = `https://help.github.com/articles/set-up-git/#platform-${platform}`

This comment was marked as spam.

@niik
niik merged commit 7b00ee9 into master Apr 20, 2017
@niik
niik deleted the do-we-have-a-git branch April 20, 2017 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants