Repository navigation
Conversation
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
@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... |
|
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 🙇 |
|
@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. |
joshaber
left a comment
There was a problem hiding this comment.
🥅
It looks like CI's complaining about some lint too.
| '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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| 'view-repository-on-github' | | ||
| 'compare-branch' | ||
| 'compare-branch' | | ||
| 'open-in-shell' No newline at end of file |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -0,0 +1,49 @@ | |||
| <# | |||
| .SYNOPSIS | |||
| Sets up the GitHub Git Shell Environment | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const currentPlatform = platform() | ||
| const command = new Command | ||
|
|
||
| switch (currentPlatform) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| /** 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.
This comment was marked as spam.
Sorry, something went wrong.
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Made requested changes 💯 |
joshaber
left a comment
There was a problem hiding this comment.
Just 2️⃣ more 📓 s. It looks like CI's still rustled about some lint too.
| else if (__WIN32__) { | ||
| commandName = 'START' | ||
| commandArgs = [ shell || 'cmd', '/D', `"${fullPath}"` , 'title', 'GitHub Desktop' ] | ||
| } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| /** 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.
This comment was marked as spam.
Sorry, something went wrong.
| commandArgs = [ shell || 'cmd', '/D', `"${fullPath}"` , 'title', 'GitHub Desktop' ] | ||
| } | ||
| else { | ||
| return fatalError |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return fatalError | ||
| } | ||
|
|
||
| return spawn(commandName, commandArgs.map(x => x), { 'shell' : true }) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Made the requested changed 💯 |
|
💥 👶 |
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 😎