Skip to content
Permalink
Browse files

feat(cli): add cli option --location for outputting where rapid-build…

… is installed
  • Loading branch information
jyounce committed Feb 1, 2018
1 parent 65f2f1f commit 03b274e850bf7818b4197e8ef5ac4a0bf48fad4a
Showing with 15 additions and 2 deletions.
  1. +2 −1 bin/build.js
  2. +3 −1 src/cli/get-cli-opts.coffee
  3. +10 −0 src/cli/location.coffee
@@ -43,9 +43,10 @@ config.build.generated.path = path.join(BUILD_PATH, 'generated');
/* Bootstrap
************/
require(path.join(config.build.cli.path, 'add-colors'))();
if (config.build.cli.opts.quickStart.length) return require(path.join(config.build.cli.path, 'quick-start'))(config);
if (!!config.build.cli.opts.cacheClean) return require(path.join(config.build.cli.path, 'cache-clean'))(config);
if (!!config.build.cli.opts.cacheList) return require(path.join(config.build.cli.path, 'cache-list'))(config);
if (!!config.build.cli.opts.location) return require(path.join(config.build.cli.path, 'location'))(config);
if (config.build.cli.opts.quickStart.length) return require(path.join(config.build.cli.path, 'quick-start'))(config);

var build = require(path.join(config.build.cli.path, 'get-build'))(config);
/**
@@ -27,16 +27,18 @@ module.exports = (config) ->
# =========
program
.version config.build.pkg.version, '-v, --version'
.option '-s, --skip-options [opts]', 'skip build option(s) ex: dev,prod', list, []
.option '--cache-clean [opt]', "cleans #{config.build.pkg.name}'s internal cache for an app, optionally provide * to clean internal cache for all apps"
.option '--cache-list', "list #{config.build.pkg.name}'s internal cache for all apps"
.option '--location', "output the location of #{config.build.pkg.name}"
.option '--quick-start [location]', 'creates a simple application structure with a couple files. optional location: client or server. defaults to both'
.option '-s, --skip-options [opts]', 'skip build option(s) ex: dev,prod', list, []
.parse process.argv

# return
# ======
opts =
cacheClean: getCacheClean program.cacheClean # bool | '*'
cacheList: program.cacheList # options n/a
location: program.location # bool
quickStart: getQuickStart program.quickStart # []
skipOpts: program.skipOptions # []
@@ -0,0 +1,10 @@
# Output the location where build is installed.
# =============================================
module.exports = (config) ->
return unless config.build.cli.opts.location

# return
# ======
location = config.build.path # :string
console.log location.attn
location

0 comments on commit 03b274e

Please sign in to comment.
You can’t perform that action at this time.