Add an option to execute additional commands before GDB when using SSH

Closes #15
This commit is contained in:
Baptist BENOIST 2016-02-10 21:27:26 +01:00
commit d6ee383e75
2 changed files with 4 additions and 1 deletions

View file

@ -24,6 +24,7 @@ export interface SSHArguments {
remotex11screen: number;
x11port: number;
x11host: string;
bootstrap: string;
}
export interface IBackend {

View file

@ -93,7 +93,9 @@ export class MI2 extends EventEmitter implements IBackend {
screen: args.remotex11screen
};
}
this.sshConn.exec(this.application + " " + this.preargs.join(" "), execArgs, (err, stream) => {
let sshCMD = this.application + " " + this.preargs.join(" ");
if (args.bootstrap) sshCMD = args.bootstrap + " && " + sshCMD;
this.sshConn.exec(sshCMD, execArgs, (err, stream) => {
if (err) {
this.log("stderr", "Could not run " + this.application + " over ssh!");
this.log("stderr", err.toString());