#! /usr/bin/env node

'use strict';

const commandLineArgs = require('command-line-args');
const rootPath = __dirname.split('node_modules')[0];
const packagePath = rootPath + 'package.json';
const pkg = require(packagePath);
const buildAngular = require('./functions/buildAngular');

// Parse inline arguments
const optionDefinitions = [
  { name: 'configuration', type: String },
  { name: 'ignoreversion', type: Boolean },
  { name: 'nooffline', type: Boolean },
  { name: 'test', type: Boolean },
  { name: 'webplayer', type: Boolean},
  { name: 'electron', type: Boolean },
];
const options = commandLineArgs(optionDefinitions);
const destination = pkg.config.destination;
const version = pkg.version;

buildAngular(pkg, options, destination, version);
