azukiapp / azk

azk is a lightweight open source development environment orchestration tool. Instantly & safely run any environment on your local machine.
http://azk.io
Apache License 2.0
897 stars 63 forks source link

Better parse .dockerignore #520

Closed JonnyBGod closed 8 years ago

JonnyBGod commented 9 years ago

If the .dockerignore file contains empty or commented lines it is throwing error:

azk: Error: must provide pattern
azk:     at new GlobSync (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/node_modules/glob/sync.js:27:11)
azk:     at Function.globSync [as sync] (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/node_modules/glob/sync.js:22:10)
azk:     at /usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:62:17
azk:     at /usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:30:19
azk:     at Array.forEach (native)
azk:     at processPatterns (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:24:23)
azk:     at Object.file.expand (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:60:17)
azk:     at Object.file.expandMapping (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:94:8)
azk:     at /usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:159:19
azk:     at Function.map (/usr/local/Cellar/azk/0.14.6/node_modules/lodash/dist/lodash.js:3508:27)
azk:     at lodash.ctor.(anonymous function) [as map] (/usr/local/Cellar/azk/0.14.6/node_modules/lodash/dist/lodash.js:5924:31)
azk:     at Object.file.normalizeFilesArray (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/util/file.js:151:6)
azk:     at [object Object].Archiver.bulk (/usr/local/Cellar/azk/0.14.6/node_modules/archiver/lib/core.js:342:25)
azk:     at callee$1$0$ (/azk:0.14.6/src/docker/build.js:74:13)
azk:     at tryCatch (/usr/local/Cellar/azk/0.14.6/node_modules/babel-runtime/regenerator/runtime.js:65:40)
azk:     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/Cellar/azk/0.14.6/node_modules/babel-runtime/regenerator/runtime.js:229:22)

It should parse the file and remove all empty and commented lines.

fearenales commented 9 years ago

Thank you for your feedback @JonnyBGod ! We're going to take a look on it and ping you back ASAP!