#352 - Custom placeholders now support scripting

This commit is contained in:
Elio Struyf
2022-07-21 18:38:53 +03:00
parent 9445ce6d37
commit 7badfda41b
10 changed files with 70 additions and 19 deletions

View File

@@ -246,7 +246,7 @@ export class CustomScript {
* @param args
* @returns
*/
private static async executeScript(script: ICustomScript, wsPath: string, args: string): Promise<string> {
public static async executeScript(script: ICustomScript, wsPath: string, args: string): Promise<string> {
return new Promise((resolve, reject) => {
// Check the command to use
@@ -264,6 +264,11 @@ export class CustomScript {
reject(error.message);
}
if (stdout && stdout.endsWith(`\n`)) {
// Remove empty line at the end of the string
stdout = stdout.slice(0, -1);
}
resolve(stdout);
});
});