Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object.keys(properties.src).forEach((srcType) => {
- properties.src[srcType].forEach((ds) => {
- // Form the Zowe CLI command.
- const command = [zoweBin, "files", "download", "all-members", `${ds}`];
- const options = ["--user", args.user,
- "--password", args.password,
- "--host", properties.zosmfHost,
- "--port", properties.zosmfPort,
- "--reject-unauthorized", "false",
- "--extension", srcType,
- "--max-concurrent-requests", 10];
- const fullCmd = command.concat(options);
- // Issue the zowe files download all-members command
- console.log(`Issuing zowe command:`);
- console.log(command.join(" ") + "...\n");
- const zoweResponse = spawnSync(fullCmd[0], fullCmd.splice(1), { cwd: srcDir });
- if (zoweResponse.error) {
- console.error(`Unable to spawn zowe command: ${zoweResponse.error.message}`);
- if (zoweResponse.error.message.indexOf("ENOENT") >= 0) {
- console.error('It appears that "zowe" is not installed.');
- }
- console.error("");
- process.exit(1);
- }
- // Print stdout and stderr
- if (zoweResponse.stderr) {
- console.error(zoweResponse.stderr.toString());
- }
- if (zoweResponse.stdout) {
- console.log(zoweResponse.stdout.toString());
- }
- // Print the response
- console.log(`Command exited with "${zoweResponse.status}".`);
- if (zoweResponse.status !== 0) {
- console.error("Review the output above for errors.\n");
- process.exit(1);
- }
- console.log("");
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement