mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-17 18:09:59 +00:00
fixed cli args handling
This commit is contained in:
parent
891fa5770a
commit
e2b11c83d5
@ -154,7 +154,7 @@ export class HostAppService {
|
|||||||
electron.ipcRenderer.on('cli', (_$event, argv: any, cwd: string, secondInstance: boolean) => this.zone.run(async () => {
|
electron.ipcRenderer.on('cli', (_$event, argv: any, cwd: string, secondInstance: boolean) => this.zone.run(async () => {
|
||||||
this.logger.info('Second instance', argv)
|
this.logger.info('Second instance', argv)
|
||||||
const op = argv._[0]
|
const op = argv._[0]
|
||||||
const opAsPath = path.resolve(cwd, op)
|
const opAsPath = op ? path.resolve(cwd, op) : null
|
||||||
if (op === 'open') {
|
if (op === 'open') {
|
||||||
this.cliOpenDirectory.next(path.resolve(cwd, argv.directory))
|
this.cliOpenDirectory.next(path.resolve(cwd, argv.directory))
|
||||||
} else if (op === 'run') {
|
} else if (op === 'run') {
|
||||||
@ -167,9 +167,9 @@ export class HostAppService {
|
|||||||
this.cliPaste.next(text)
|
this.cliPaste.next(text)
|
||||||
} else if (op === 'profile') {
|
} else if (op === 'profile') {
|
||||||
this.cliOpenProfile.next(argv.profileName)
|
this.cliOpenProfile.next(argv.profileName)
|
||||||
} else if (op === undefined) {
|
} else if (secondInstance && op === undefined) {
|
||||||
this.newWindow()
|
this.newWindow()
|
||||||
} else if ((await fs.lstat(opAsPath)).isDirectory()) {
|
} else if (opAsPath && (await fs.lstat(opAsPath)).isDirectory()) {
|
||||||
this.cliOpenDirectory.next(opAsPath)
|
this.cliOpenDirectory.next(opAsPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user