Skip to content

Commit

Permalink
make createPackageFromFiles works without providing any options or me…
Browse files Browse the repository at this point in the history
…tadata
  • Loading branch information
akinoniku committed Aug 17, 2018
1 parent 0476040 commit db030d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/asar.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ callback: The callback function. Accepts (err).
*/
module.exports.createPackageFromFiles = function (src, dest, filenames, metadata, options, callback) {
if (typeof metadata === 'undefined' || metadata === null) { metadata = {} }
if (typeof options === 'undefined' || options === null) { options = {} }
const filesystem = new Filesystem(src)
const files = []
const unpackDirs = []
Expand Down Expand Up @@ -103,7 +104,9 @@ module.exports.createPackageFromFiles = function (src, dest, filenames, metadata

console.log(`Ordering file has ${((total - missing) / total) * 100}% coverage.`)
} else {
filenamesSorted = filenames
for (const file of filenames) {
filenamesSorted.push(path.join(src, file))
}
}

const handleFile = function (filename, done) {
Expand All @@ -115,6 +118,7 @@ module.exports.createPackageFromFiles = function (src, dest, filenames, metadata
if (stat.isFile()) { type = 'file' }
if (stat.isSymbolicLink()) { type = 'link' }
file = {stat, type}
metadata[filename] = file
}

let shouldUnpack
Expand Down

0 comments on commit db030d2

Please sign in to comment.