amberc 666 B

123456789101112131415161718
  1. #!/usr/bin/env node
  2. var path = require('path');
  3. var amberc = require('./amberc.js');
  4. // get parameters passed to the command line script
  5. // discard the first two parameters which are the node binary and the script name
  6. var parameters = process.argv.slice(2);
  7. // Get Amber root directory from the location of this script so that
  8. // we can find the st and js directories etc.
  9. var amber_dir = path.normalize(path.join(path.dirname(process.argv[1]), '..'));
  10. // Get default location of compiler.jar
  11. var closure_jar = path.resolve(path.join(process.env['HOME'], 'compiler.jar'));
  12. var compiler = new amberc.Compiler(amber_dir, closure_jar);
  13. compiler.main(parameters);