Application launch path should use native path functions

This commit is contained in:
WebFreak001 2016-02-10 13:55:07 +01:00
commit 39fe07d742

View file

@ -5,6 +5,7 @@ import { parseMI, MINode } from '../mi_parse';
import * as net from "net"
import * as fs from "fs"
import { posix } from "path"
import * as nativePath from "path"
let path = posix;
var Client = require("ssh2").Client;
@ -26,8 +27,8 @@ export class MI2 extends EventEmitter implements IBackend {
}
load(cwd: string, target: string): Thenable<any> {
if (!path.isAbsolute(target.replace(/\\/g, "/")))
target = path.join(cwd.replace(/\\/g, "/"), target.replace(/\\/g, "/"));
if (!nativePath.isAbsolute(target))
target = nativePath.join(cwd, target);
return new Promise((resolve, reject) => {
this.isSSH = false;
this.process = ChildProcess.spawn(this.application, this.preargs.concat([target]), { cwd: cwd });