Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. Object.keys(properties.src).forEach((srcType) => {
  2. properties.src[srcType].forEach((ds) => {
  3. // Form the Zowe CLI command.
  4. const command = [zoweBin, "files", "download", "all-members", `${ds}`];
  5. const options = ["--user", args.user,
  6. "--password", args.password,
  7. "--host", properties.zosmfHost,
  8. "--port", properties.zosmfPort,
  9. "--reject-unauthorized", "false",
  10. "--extension", srcType,
  11. "--max-concurrent-requests", 10];
  12. const fullCmd = command.concat(options);
  13. // Issue the zowe files download all-members command
  14. console.log(`Issuing zowe command:`);
  15. console.log(command.join(" ") + "...\n");
  16. const zoweResponse = spawnSync(fullCmd[0], fullCmd.splice(1), { cwd: srcDir });
  17. if (zoweResponse.error) {
  18. console.error(`Unable to spawn zowe command: ${zoweResponse.error.message}`);
  19. if (zoweResponse.error.message.indexOf("ENOENT") >= 0) {
  20. console.error('It appears that "zowe" is not installed.');
  21. }
  22. console.error("");
  23. process.exit(1);
  24. }
  25. // Print stdout and stderr
  26. if (zoweResponse.stderr) {
  27. console.error(zoweResponse.stderr.toString());
  28. }
  29. if (zoweResponse.stdout) {
  30. console.log(zoweResponse.stdout.toString());
  31. }
  32. // Print the response
  33. console.log(`Command exited with "${zoweResponse.status}".`);
  34. if (zoweResponse.status !== 0) {
  35. console.error("Review the output above for errors.\n");
  36. process.exit(1);
  37. }
  38. console.log("");
  39. });
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement