mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-04-30 18:42:25 +02:00
#352 - Custom placeholders now support scripting
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user