How to use the @zowe/imperative.IO.deleteFile function in @zowe/imperative

To help you get started, we’ve selected a few @zowe/imperative examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / zowe-cli-cics-deploy-plugin / __tests__ / __src__ / environment / TestEnvironment.ts View on Github external
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);
    }