Guest User

Untitled

a guest
Dec 24th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. if (!module.parent) {
  2. Step(
  3. function() {
  4. var rl = readline.createInterface(process.stdin, process.stdout, null);
  5. var loginCallback = this.parallel();
  6. var configCallback = this.parallel();
  7. var fixturesCallback = this.parallel();
  8. rl.question("Enter your CouchDB username: ", function(username) {
  9. rl.question("Enter your CouchDB password (NOTE: THIS WILL BE ECHOED ON YOUR SCREEN): ", function(password) {
  10. rl.close();
  11. process.stdin.destroy();
  12. loginCallback(null, {username: username, password: password});
  13. });
  14. });
  15. fs.readFile('config.js', function(err, configFile) {
  16. if (err) {
  17. return configCallback(err, null);
  18. }
  19. var config = JSON.parse(configFile);
  20. configCallback(null, config);
  21. });
  22. fs.readFile('fixtures.json', function(err, fixturesFile) {
  23. if (err) {
  24. return fixturesCallback(err, null);
  25. }
  26. var fixtures = JSON.parse(fixturesFile);
  27. fixturesCallback(null, fixtures);
  28. });
  29. },
  30. function(err, loginInfo, config, fixtures) {
  31. if (err) {
  32. throw err;
  33. }
  34. main(config, loginInfo.username, loginInfo.password, fixtures);
  35. }
  36. );
  37. }
Add Comment
Please, Sign In to add comment