mirror of
https://github.com/desktop/desktop
synced 2024-10-31 11:59:53 +00:00
try to fix linux prompt
This commit is contained in:
parent
fb4a54c9fb
commit
7bc697ea72
3 changed files with 11 additions and 1 deletions
3
app/src/lib/globals.d.ts
vendored
3
app/src/lib/globals.d.ts
vendored
|
@ -13,6 +13,9 @@ declare const __DARWIN__: boolean
|
|||
/** Is the app being built to run on Win32? */
|
||||
declare const __WIN32__: boolean
|
||||
|
||||
/** Is the app being built to run on Linux? */
|
||||
declare const __LINUX__: boolean
|
||||
|
||||
/**
|
||||
* The commit id of the repository HEAD at build time.
|
||||
* Represented as a 40 character SHA-1 hexadecimal digest string.
|
||||
|
|
|
@ -15,6 +15,11 @@ export function openShell(fullPath: string, shell?: string) {
|
|||
return spawn('START', [shell || 'cmd'], { shell: true, cwd: fullPath })
|
||||
}
|
||||
|
||||
if (__LINUX__) {
|
||||
const commandArgs = ['--working-directory', fullPath]
|
||||
return spawn('gnome-terminal', commandArgs, { shell: true })
|
||||
}
|
||||
|
||||
return fatalError('Unsupported OS')
|
||||
}
|
||||
|
||||
|
@ -22,7 +27,8 @@ export function isGitOnPath(): Promise<boolean> {
|
|||
// Modern versions of macOS ship with a Git shim that guides you through
|
||||
// the process of setting everything up. We trust this is available, so
|
||||
// don't worry about looking for it here.
|
||||
if (__DARWIN__) {
|
||||
// I decide linux user have git too :)
|
||||
if (__DARWIN__ || __LINUX__) {
|
||||
return Promise.resolve(true)
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ const replacements = {
|
|||
),
|
||||
__DARWIN__: process.platform === 'darwin',
|
||||
__WIN32__: process.platform === 'win32',
|
||||
__LINUX__: process.platform === 'linux',
|
||||
__DEV__: environment === 'development',
|
||||
__RELEASE_ENV__: JSON.stringify(environment),
|
||||
__SHA__: JSON.stringify(revParse(path.resolve(__dirname, '../.git'), 'HEAD')),
|
||||
|
|
Loading…
Reference in a new issue