Comparing version 0.10.0 to 0.11.0
@@ -46,2 +46,3 @@ (function() { | ||
/* | ||
@@ -55,7 +56,6 @@ createPackageFromFiles - Create an asar-archive from a list of filenames | ||
callback: The callback function. Accepts (err). | ||
*/ | ||
*/ | ||
module.exports.createPackageFromFiles = function(src, dest, filenames, metadata, options, callback) { | ||
var dirName, file, filename, filenamesSorted, files, filesystem, missing, ordering, orderingFiles, pathComponent, pathComponents, shouldUnpack, stat, str, total, type, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m; | ||
var dirName, file, filename, filenamesSorted, files, filesystem, i, j, k, l, len, len1, len2, len3, len4, m, missing, ordering, orderingFiles, pathComponent, pathComponents, shouldUnpack, stat, str, total, type; | ||
if (metadata == null) { | ||
@@ -78,8 +78,8 @@ metadata = {}; | ||
ordering = []; | ||
for (_i = 0, _len = orderingFiles.length; _i < _len; _i++) { | ||
file = orderingFiles[_i]; | ||
for (i = 0, len = orderingFiles.length; i < len; i++) { | ||
file = orderingFiles[i]; | ||
pathComponents = file.split(path.sep); | ||
str = src; | ||
for (_j = 0, _len1 = pathComponents.length; _j < _len1; _j++) { | ||
pathComponent = pathComponents[_j]; | ||
for (j = 0, len1 = pathComponents.length; j < len1; j++) { | ||
pathComponent = pathComponents[j]; | ||
str = path.join(str, pathComponent); | ||
@@ -92,4 +92,4 @@ ordering.push(str); | ||
total = filenames.length; | ||
for (_k = 0, _len2 = ordering.length; _k < _len2; _k++) { | ||
file = ordering[_k]; | ||
for (k = 0, len2 = ordering.length; k < len2; k++) { | ||
file = ordering[k]; | ||
if (filenamesSorted.indexOf(file) === -1 && filenames.indexOf(file) !== -1) { | ||
@@ -99,4 +99,4 @@ filenamesSorted.push(file); | ||
} | ||
for (_l = 0, _len3 = filenames.length; _l < _len3; _l++) { | ||
file = filenames[_l]; | ||
for (l = 0, len3 = filenames.length; l < len3; l++) { | ||
file = filenames[l]; | ||
if (filenamesSorted.indexOf(file) === -1) { | ||
@@ -111,4 +111,4 @@ filenamesSorted.push(file); | ||
} | ||
for (_m = 0, _len4 = filenamesSorted.length; _m < _len4; _m++) { | ||
filename = filenamesSorted[_m]; | ||
for (m = 0, len4 = filenamesSorted.length; m < len4; m++) { | ||
filename = filenamesSorted[m]; | ||
file = metadata[filename]; | ||
@@ -191,3 +191,3 @@ if (!file) { | ||
module.exports.extractAll = function(archive, dest) { | ||
var content, destFilename, error, file, filename, filenames, filesystem, followLinks, linkDestPath, linkSrcPath, linkTo, relativePath, _i, _len, _results; | ||
var content, destFilename, error, file, filename, filenames, filesystem, followLinks, i, len, linkDestPath, linkSrcPath, linkTo, relativePath, results; | ||
filesystem = disk.readFilesystemSync(archive); | ||
@@ -197,5 +197,5 @@ filenames = filesystem.listFiles(); | ||
mkdirp.sync(dest); | ||
_results = []; | ||
for (_i = 0, _len = filenames.length; _i < _len; _i++) { | ||
filename = filenames[_i]; | ||
results = []; | ||
for (i = 0, len = filenames.length; i < len; i++) { | ||
filename = filenames[i]; | ||
filename = filename.substr(1); | ||
@@ -205,3 +205,3 @@ destFilename = path.join(dest, filename); | ||
if (file.files) { | ||
_results.push(mkdirp.sync(destFilename)); | ||
results.push(mkdirp.sync(destFilename)); | ||
} else if (file.link) { | ||
@@ -217,11 +217,11 @@ linkSrcPath = path.dirname(path.join(dest, file.link)); | ||
linkTo = path.join(relativePath, path.basename(file.link)); | ||
_results.push(fs.symlinkSync(linkTo, destFilename)); | ||
results.push(fs.symlinkSync(linkTo, destFilename)); | ||
} else { | ||
content = disk.readFileSync(filesystem, filename, file); | ||
_results.push(fs.writeFileSync(destFilename, content)); | ||
results.push(fs.writeFileSync(destFilename, content)); | ||
} | ||
} | ||
return _results; | ||
return results; | ||
}; | ||
}).call(this); |
@@ -12,8 +12,8 @@ (function() { | ||
return glob(dir + '/**/*', options, function(error, filenames) { | ||
var filename, stat, _i, _len; | ||
var filename, i, len, stat; | ||
if (error) { | ||
return callback(error); | ||
} | ||
for (_i = 0, _len = filenames.length; _i < _len; _i++) { | ||
filename = filenames[_i]; | ||
for (i = 0, len = filenames.length; i < len; i++) { | ||
filename = filenames[i]; | ||
stat = fs.lstatSync(filename); | ||
@@ -20,0 +20,0 @@ if (stat.isFile()) { |
@@ -38,3 +38,3 @@ (function() { | ||
try { | ||
copyFileToSync("" + dest + ".unpacked", filesystem.src, filename); | ||
copyFileToSync(dest + ".unpacked", filesystem.src, filename); | ||
} catch (_error) { | ||
@@ -122,3 +122,3 @@ error = _error; | ||
if (info.unpacked) { | ||
buffer = fs.readFileSync(path.join("" + filesystem.src + ".unpacked", filename)); | ||
buffer = fs.readFileSync(path.join(filesystem.src + ".unpacked", filename)); | ||
} else { | ||
@@ -125,0 +125,0 @@ fd = fs.openSync(filesystem.src, 'r'); |
@@ -20,7 +20,7 @@ (function() { | ||
Filesystem.prototype.searchNodeFromDirectory = function(p) { | ||
var dir, dirs, json, _i, _len; | ||
var dir, dirs, i, json, len; | ||
json = this.header; | ||
dirs = p.split(path.sep); | ||
for (_i = 0, _len = dirs.length; _i < _len; _i++) { | ||
dir = dirs[_i]; | ||
for (i = 0, len = dirs.length; i < len; i++) { | ||
dir = dirs[i]; | ||
if (dir !== '.') { | ||
@@ -34,3 +34,3 @@ json = json.files[dir]; | ||
Filesystem.prototype.searchNodeFromPath = function(p) { | ||
var name, node, _base; | ||
var base, name, node; | ||
p = path.relative(this.src, p); | ||
@@ -45,4 +45,4 @@ if (!p) { | ||
} | ||
if ((_base = node.files)[name] == null) { | ||
_base[name] = {}; | ||
if ((base = node.files)[name] == null) { | ||
base[name] = {}; | ||
} | ||
@@ -71,3 +71,3 @@ return node.files[name]; | ||
if (stat.size > 4294967295) { | ||
throw new Error("" + p + ": file size can not be larger than 4.2GB"); | ||
throw new Error(p + ": file size can not be larger than 4.2GB"); | ||
} | ||
@@ -86,3 +86,3 @@ node.size = stat.size; | ||
if (link.substr(0, 2) === '..') { | ||
throw new Error("" + p + ": file links out of the package"); | ||
throw new Error(p + ": file links out of the package"); | ||
} | ||
@@ -97,13 +97,13 @@ node = this.searchNodeFromPath(p); | ||
fillFilesFromHeader = function(p, json) { | ||
var f, fullPath, _results; | ||
var f, fullPath, results; | ||
if (!json.files) { | ||
return; | ||
} | ||
_results = []; | ||
results = []; | ||
for (f in json.files) { | ||
fullPath = path.join(p, f); | ||
files.push(fullPath); | ||
_results.push(fillFilesFromHeader(fullPath, json.files[f])); | ||
results.push(fillFilesFromHeader(fullPath, json.files[f])); | ||
} | ||
return _results; | ||
return results; | ||
}; | ||
@@ -110,0 +110,0 @@ fillFilesFromHeader('/', this.header); |
@@ -36,8 +36,8 @@ (function() { | ||
createSnapshot = function(src, dest, filenames, metadata, options, callback) { | ||
var arch, builddir, compiled, content, error, file, filename, relativeFilename, script, snapshotdir, str, target, version, _i, _len; | ||
var arch, builddir, compiled, content, error, file, filename, i, len, relativeFilename, script, snapshotdir, str, target, version; | ||
try { | ||
src = path.resolve(src); | ||
content = {}; | ||
for (_i = 0, _len = filenames.length; _i < _len; _i++) { | ||
filename = filenames[_i]; | ||
for (i = 0, len = filenames.length; i < len; i++) { | ||
filename = filenames[i]; | ||
file = metadata[filename]; | ||
@@ -44,0 +44,0 @@ if ((file.type === 'file' || file.type === 'link') && filename.substr(-3) === '.js') { |
@@ -5,3 +5,3 @@ { | ||
"description": "Creating atom-shell app packages", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"bin": { | ||
@@ -11,9 +11,9 @@ "asar": "bin/asar" | ||
"license": "MIT", | ||
"homepage": "https://github.com/atom/asar", | ||
"homepage": "https://github.com/electron/asar", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/atom/asar.git" | ||
"url": "https://github.com/electron/asar.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/atom/asar/issues" | ||
"url": "https://github.com/electron/asar/issues" | ||
}, | ||
@@ -33,3 +33,3 @@ "scripts": { | ||
"mkdirp": "^0.5.0", | ||
"mksnapshot": "^0.1.0" | ||
"mksnapshot": "^0.3.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
@@ -1,5 +0,5 @@ | ||
# asar - Atom-Shell Archive | ||
# asar - Electron Archive | ||
[![build status](http://img.shields.io/travis/atom/asar.svg?style=flat-square)](https://travis-ci.org/atom/asar) | ||
[![dependencies](http://img.shields.io/david/atom/asar.svg?style=flat-square)](https://david-dm.org/atom/asar) | ||
[![build status](http://img.shields.io/travis/electron/asar.svg?style=flat-square)](https://travis-ci.org/electron/asar) | ||
[![dependencies](http://img.shields.io/david/electron/asar.svg?style=flat-square)](https://david-dm.org/electron/asar) | ||
[![npm version](http://img.shields.io/npm/v/asar.svg?style=flat-square)](https://npmjs.org/package/asar) | ||
@@ -6,0 +6,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31827
1
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddecompress-zip@0.3.3(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfs-extra@0.26.7(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedklaw@1.3.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmksnapshot@0.3.5(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.10.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedasn1@0.1.11(transitive)
- Removedassert-plus@0.1.5(transitive)
- Removedasync@0.9.2(transitive)
- Removedaws-sign2@0.5.0(transitive)
- Removedbl@0.9.5(transitive)
- Removedbluebird@2.11.0(transitive)
- Removedboom@2.10.1(transitive)
- Removedcaseless@0.9.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedcryptiles@2.0.5(transitive)
- Removedctype@0.5.3(transitive)
- Removeddecompress-zip@0.1.0(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedform-data@0.2.0(transitive)
- Removedfs-extra@0.18.2(transitive)
- Removedgenerate-function@2.3.1(transitive)
- Removedgenerate-object-property@1.2.0(transitive)
- Removedgraceful-fs@3.0.12(transitive)
- Removedhar-validator@1.8.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhawk@2.3.1(transitive)
- Removedhoek@2.16.3(transitive)
- Removedhttp-signature@0.10.1(transitive)
- Removedis-my-ip-valid@1.0.1(transitive)
- Removedis-my-json-valid@2.20.6(transitive)
- Removedis-property@1.0.2(transitive)
- Removedjsonpointer@5.0.1(transitive)
- Removedmime-db@1.12.0(transitive)
- Removedmime-types@2.0.14(transitive)
- Removedmksnapshot@0.1.0(transitive)
- Removednatives@1.1.6(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedoauth-sign@0.6.0(transitive)
- Removedqs@2.4.2(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedrequest@2.55.0(transitive)
- Removedsntp@1.0.9(transitive)
- Removedstringstream@0.0.6(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtldts@6.1.59(transitive)
- Removedtldts-core@6.1.59(transitive)
- Removedtough-cookie@5.0.0(transitive)
- Removedtunnel-agent@0.4.3(transitive)
- Removedxtend@4.0.2(transitive)
Updatedmksnapshot@^0.3.0