jonschlinkert / add-banner

Add a banner to a string. Banners are just Lo-Dash/underscore templates, if a custom one isn't defined a default will be used.
https://github.com/jonschlinkert
MIT License
7 stars 16 forks source link

ERR_INVALID_CALLBACK error on CLI use on Node.js 10 #10

Open ain opened 6 years ago

ain commented 6 years ago

Node.js 9 (succeeds with deprecation warning):

> add-banner --template=banner.tmpl dist/*.*s
(node:43596) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

Node.js 10 (fails):

> add-banner --template=banner.tmpl dist/*.*s

fs.js:133
  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:133:9)
    at Object.writeFile (fs.js:1139:14)
    at argv._.forEach.file (/Users/ain/Documents/projects/smartbanner.js/node_modules/add-banner/bin/add-banner.js:22:10)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/ain/Documents/projects/smartbanner.js/node_modules/add-banner/bin/add-banner.js:21:8)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
ain commented 6 years ago

@jonschlinkert I've just fixed this in dc2401f of #14.