Skip to content
Permalink
Browse files

fix(bower): do not download the build's default bower files when opti…

…on exclude.default.client.files is true
  • Loading branch information
jyounce committed May 16, 2016
1 parent 5a97f8d commit d73f3538ca11340939c405cb0c9d10399d35f2c5
@@ -23,7 +23,8 @@ module.exports = (config, options) ->
exclude =
spa: !!options.exclude.spa
angular:
files: get.opt.deep2 'angular', 'files', false
files: get.opt.deep2 'angular', 'files', false
modules: get.opt.deep2 'angular', 'modules', false
default:
client:
files: get.opt.deep3 'default', 'client', 'files', false
@@ -54,6 +55,14 @@ module.exports = (config, options) ->
client: get.opt.deep3 'from', 'dist', 'client', []
server: get.opt.deep3 'from', 'dist', 'server', []

# update spa val
# ==============
updateExcludeSpa = ->
return if config.spa.custom
exclude.spa = true if exclude.default.client.files

updateExcludeSpa()

# format options
# ==============
formatFilesFrom = (opt, type) -> # prepend dist path to values then prepend '!'
@@ -1,7 +1,8 @@
module.exports = (config, gulp) ->
q = require 'q'
rename = require 'gulp-rename'
template = require 'gulp-template'
q = require 'q'
rename = require 'gulp-rename'
template = require 'gulp-template'
promiseHelp = require "#{config.req.helpers}/promise"

# helpers
# =======
@@ -27,6 +28,7 @@ module.exports = (config, gulp) ->

# return
# ======
return promiseHelp.get() if config.exclude.default.client.files
api.runTask(
config.templates.angularModules.src.path
config.templates.angularModules.dest.dir
@@ -53,9 +53,11 @@ module.exports = (config, gulp) ->
# ===
api =
runTask: ->
defer = q.defer()
defer = q.defer()
rbExclude = true if config.exclude.default.client.files
rbExclude = true if config.exclude.angular.files
q.all([
getComponents 'rb', config.exclude.angular.files
getComponents 'rb', rbExclude
getComponents 'app'
]).done -> defer.resolve()
defer.promise
@@ -4,7 +4,9 @@ module.exports = (config) ->
promiseHelp = require "#{config.req.helpers}/promise"
bowerHelper = require("#{config.req.helpers}/bower") config

runTask = (appOrRb) ->
runTask = (appOrRb, exclude) ->
return promiseHelp.get() if exclude

defer = q.defer()
bowerPkgs = bowerHelper.get.pkgs.to.install appOrRb
return promiseHelp.get defer if not bowerPkgs or not bowerPkgs.length
@@ -27,9 +29,10 @@ module.exports = (config) ->
# ===
api =
runTask: ->
defer = q.defer()
defer = q.defer()
rbExclude = true if config.exclude.default.client.files
q.all([
runTask 'rb'
runTask 'rb', rbExclude
runTask 'app'
]).done -> defer.resolve()
defer.promise
@@ -28,6 +28,8 @@ module.exports = (config, gulp) ->
api =
runTask: ->
return promiseHelp.get() if config.angular.httpBackend.enabled
return promiseHelp.get() if config.exclude.default.client.files

data = getData()
src = path.join config.templates.dir, 'inject-angular-mocks.tpl'
dest = config.src.rb.client.test.dir
@@ -41,6 +41,8 @@ module.exports = (config, gulp) ->
api =
runTask: ->
return promiseHelp.get() if config.angular.httpBackend.enabled
return promiseHelp.get() if config.exclude.default.client.files

src = bowerHelper.get.src 'rb', pkg:'angular-mocks', test:true
dest = config.src.rb.client.test.dir
# console.log src

0 comments on commit d73f353

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