Skip to content
Permalink
Browse files

fix(angular.templateCache.dev option): error caused by gulp 4 upgrade

  • Loading branch information
jyounce committed Oct 17, 2017
1 parent 7cc5c28 commit 2927a2359d3da0aaca65e8a85acf85c5c7107cbc
Showing with 17 additions and 13 deletions.
  1. +12 −8 src/helpers/dir.coffee
  2. +4 −4 src/helpers/promise.coffee
  3. +1 −1 src/tasks/minify/template-cache.coffee
@@ -1,8 +1,10 @@
module.exports = (config, gulp) ->
q = require 'q'
fs = require 'fs'
path = require 'path'
log = require "#{config.req.helpers}/log"
module.exports = (config) ->
q = require 'q'
fs = require 'fs'
path = require 'path'
gs = require 'glob-stream'
log = require "#{config.req.helpers}/log"
promiseHelp = require "#{config.req.helpers}/promise"

# helpers
# =======
@@ -68,13 +70,15 @@ module.exports = (config, gulp) ->
# returns promise with hasFiles boolean value
hasFiles: (src) ->
defer = q.defer()
opts = buffer:false, read:false
opts = buffer:false, read:false, allowEmpty:true
hasFiles = false
gulp.src src, opts
return promiseHelp.get defer, hasFiles unless src and src.length

gs src, opts
.on 'data', (file) ->
return unless file
hasFiles = true
@.end()
@destroy()
.on 'end', ->
defer.resolve hasFiles
defer.promise
@@ -1,12 +1,12 @@
module.exports =
delay: (delay, defer) ->
delay: (delay, defer, resolved) ->
defer = require('q').defer() unless defer
setTimeout ->
defer.resolve()
defer.resolve resolved
, delay
defer.promise

get: (defer) ->
get: (defer, resolved) ->
defer = require('q').defer() unless defer
defer.resolve()
defer.resolve resolved
defer.promise
@@ -8,7 +8,7 @@ module.exports = (config, gulp, taskOpts={}) ->
compileHtmlScripts = require "#{config.req.plugins}/gulp-compile-html-scripts"
log = require "#{config.req.helpers}/log"
ngFormify = require "#{config.req.plugins}/gulp-ng-formify"
dirHelper = require("#{config.req.helpers}/dir") config, gulp
dirHelper = require("#{config.req.helpers}/dir") config
runNgFormify = config.angular.ngFormify
forWatchFile = !!taskOpts.watchFile

0 comments on commit 2927a23

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