'use strict';

var commander = require('commander');
var errors = require('./lib/errors.cjs.js');
var _package = require('./package.json.cjs.js');
var createApp = require('./createApp.cjs.js');

const main = (argv) => {
  commander.program.name("backstage-create-app").version(_package.version).description("Creates a new app in a new directory or specified path").option(
    "--path [directory]",
    "Location to store the app defaulting to a new folder with the app name"
  ).option(
    "--skip-install",
    "Skip the install and builds steps after creating the app"
  ).option(
    "--template-path [directory]",
    "Use an external application template instead of the default template"
  ).action((cmd) => createApp.default(cmd));
  commander.program.parse(argv);
};
process.on("unhandledRejection", (rejection) => {
  if (rejection instanceof Error) {
    errors.exitWithError(rejection);
  } else {
    errors.exitWithError(new Error(`Unknown rejection: '${rejection}'`));
  }
});
main(process.argv);
//# sourceMappingURL=index.cjs.js.map
