Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private static async installPlugin(testEnvironment: ITestEnvironment) {
let installScript: string = TemporaryScripts.SHEBANG;
installScript += TemporaryScripts.ZOWE_BIN + " plugins install ../../../../\n"; // install plugin from root of project
installScript += TemporaryScripts.ZOWE_BIN + " plugins validate @brightside/zowe-cli-cics-deploy-plugin\n";
installScript += TemporaryScripts.ZOWE_BIN + " cdep --help\n"; // check that the plugin help is available
const scriptPath = testEnvironment.workingDir + "/install_plugin.sh";
IO.writeFile(scriptPath, Buffer.from(installScript));
const output = runCliScript(scriptPath, testEnvironment, []);
if (output.status !== 0) {
throw new ImperativeError({
msg: "Install of '@brightside/zowe-cli-cics-deploy-plugin' plugin failed! You should delete the script: \n'" + scriptPath + "' " +
"after reviewing it to check for possible errors.\n Output of the plugin install command:\n" + output.stderr.toString() +
output.stdout.toString()
});
}
IO.deleteFile(scriptPath);
}