Skip to content

Add ability to open repo in terminal - #845

Merged
joshaber merged 29 commits into
masterfrom
term-me
Feb 1, 2017
Merged

joshaber merged 29 commits into
masterfrom
term-me

Conversation

@iAmWillShepherd

Copy link
Copy Markdown
Contributor

This PR is intended to close #809.

This functionality is tested to work on Mac OS. I may need some walkthrough on how to get Desktop running on Windows and Linux to test there as well.

I also am open to code design input as this is still all work in progress 😎

This menu item will be responsible for opening the current repo in a terminal
Public interface for the openInTerminal function is not flehed out. Will also consider a generic external open function that can open a terminal.
Items now are consistent with platform conventions
@shiftkey

Copy link
Copy Markdown
Member

I may need some walkthrough on how to get Desktop running on Windows and Linux to test there as well.

@iAmWillShepherd not sure if you've read the Getting Started guide but the instructions should work the same for Windows. Don't worry about Linux - #273 is probably out first step, but not something you should worry about here...

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

Got it. I remember going through this with Josh on my first day, but honestly forgot about its existence. Still coming up to speed on things 🙇

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

@shiftkey do you think I should return the spawned process to the caller? Not sure if it would be worth doing now or waiting until someone wants to do something with the return process.

@iAmWillShepherd iAmWillShepherd changed the title [WIP] Add ability to open repo in terminal Add ability to open repo in terminal Feb 1, 2017
@joshaber joshaber self-assigned this Feb 1, 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.

🥅

It looks like CI's complaining about some lint too.

Comment thread app/src/main-process/menu/menu-event.ts Outdated
'compare-branch'
'open-in-shell' |
'compare-branch' |
'view-repository-on-github' No newline at end of file

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/main-process/menu/menu-ids.ts Outdated
'view-repository-on-github' |
'compare-branch'
'compare-branch' |
'open-in-shell' No newline at end of file

This comment was marked as spam.

Comment thread app/static/win32/shell.ps1 Outdated
@@ -0,0 +1,49 @@
<#
.SYNOPSIS
Sets up the GitHub Git Shell Environment

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/lib/open-shell.ts Outdated
const currentPlatform = platform()
const command = new Command

switch (currentPlatform) {

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/lib/open-shell.ts Outdated
/** Opens a shell setting the working directory to fullpath. If a shell is not specified, OS defaults are used. */
export function openShell(fullPath: string, shell?: string) {
const currentPlatform = platform()
const command = new Command

This comment was marked as spam.

Comment thread app/src/ui/app.tsx Outdated
setMenuEnabled('merge-branch', onBranch)
setMenuEnabled('view-repository-on-github', isHostedOnGitHub)
setMenuEnabled('compare-branch', isHostedOnGitHub && hasPublishedBranch)
setMenuEnabled('open-in-shell', onBranch)

This comment was marked as spam.

This comment was marked as spam.

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

Made requested changes 💯

@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.

Just 2️⃣ more 📓 s. It looks like CI's still rustled about some lint too.

Comment thread app/src/lib/open-shell.ts
else if (__WIN32__) {
commandName = 'START'
commandArgs = [ shell || 'cmd', '/D', `"${fullPath}"` , 'title', 'GitHub Desktop' ]
}

This comment was marked as spam.

Comment thread app/src/lib/open-shell.ts Outdated
/** Opens a shell setting the working directory to fullpath. If a shell is not specified, OS defaults are used. */
export function openShell(fullPath: string, shell?: string) {
let commandName: string = ''
let commandArgs: string[] = []

This comment was marked as spam.

@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.

A couple more 📔 s

Comment thread app/src/lib/open-shell.ts Outdated
commandArgs = [ shell || 'cmd', '/D', `"${fullPath}"` , 'title', 'GitHub Desktop' ]
}
else {
return fatalError

This comment was marked as spam.

Comment thread app/src/lib/open-shell.ts Outdated
return fatalError
}

return spawn(commandName, commandArgs.map(x => x), { 'shell' : true })

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

Made the requested changed 💯

@joshaber

joshaber commented Feb 1, 2017

Copy link
Copy Markdown
Contributor

💥 👶

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.

3 participants