Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call spawn with absolute path if the file exists, or relative path if it doesn't #698

Merged
merged 2 commits into from
Apr 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/modules/enginesyncer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {remote} from 'electron'
import EventEmitter from 'events'
import {existsSync} from 'fs'
import {dirname, resolve} from 'path'
import argvsplit from 'argv-split'
import {v4 as uuid} from 'uuid'
Expand Down Expand Up @@ -87,8 +88,10 @@ export default class EngineSyncer extends EventEmitter {
this.commands = []
this.treePosition = null

this.controller = new Controller(resolve(path), [...argvsplit(args)], {
cwd: dirname(resolve(path))
let absolutePath = resolve(path)
let executePath = existsSync(absolutePath) ? absolutePath : path
this.controller = new Controller(executePath, [...argvsplit(args)], {
cwd: dirname(absolutePath)
})

this.stateTracker = new ControllerStateTracker(this.controller)
Expand Down