Skip to content

Commit 4070f75

Browse files
authored
Merge pull request #1 from KaneOne/fix-work-path
Update index.ts
2 parents 304da70 + 0098bb6 commit 4070f75

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,15 @@ export class PythonShell extends EventEmitter {
162162
let pythonOptions = toArray(options.pythonOptions);
163163
let scriptArgs = toArray(options.args);
164164

165-
this.scriptPath = join(options.scriptPath || '', scriptPath);
165+
this.scriptPath = scriptPath;
166166
this.command = pythonOptions.concat(this.scriptPath, scriptArgs);
167167
this.mode = options.mode || 'text';
168168
this.formatter = resolve('format', options.formatter || this.mode);
169169
this.parser = resolve('parse', options.parser || this.mode);
170170
// We don't expect users to ever format stderr as JSON so we default to text mode
171171
this.stderrParser = resolve('parse', options.stderrParser || 'text');
172172
this.terminated = false;
173+
options.cwd = options.scriptPath;
173174
this.childProcess = spawn(pythonPath, this.command, options);
174175

175176
['stdout', 'stdin', 'stderr'].forEach(function (name) {

0 commit comments

Comments
 (0)