You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.7 KiB

8 years ago
  1. #!/usr/bin/env node
  2. /*
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. */
  18. var Api = require('./Api');
  19. var nopt = require('nopt');
  20. var path = require('path');
  21. // Support basic help commands
  22. if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0)
  23. require('./lib/run').help();
  24. // Do some basic argument parsing
  25. var runOpts = nopt({
  26. 'verbose' : Boolean,
  27. 'silent' : Boolean,
  28. 'debug' : Boolean,
  29. 'release' : Boolean,
  30. 'nobuild': Boolean,
  31. 'buildConfig' : path,
  32. 'archs' : String,
  33. 'device' : Boolean,
  34. 'emulator': Boolean,
  35. 'target' : String
  36. }, { 'd' : '--verbose' });
  37. // Make runOptions compatible with PlatformApi run method spec
  38. runOpts.argv = runOpts.argv.remain;
  39. require('./loggingHelper').adjustLoggerLevel(runOpts);
  40. new Api().run(runOpts)
  41. .catch(function(err) {
  42. console.error(err, err.stack);
  43. process.exit(2);
  44. });