Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeout(function () {
if (exists["app.asar.unpacked"])
_this.copyFolderRecursiveSync(rootPath + "app.asar.unpacked", rootPath + "app.asar.bak.unpacked");
_this.extractAsarAsync(rootPath + "app.asar.bak", rootPath + "_app-extract", function () {
_this.removeFrame(6, exists);
});
// Update info text on extraction progress until complete.
var total = asar.listPackage(rootPath + "app.asar.bak").length;
var progress;
var intervalId = setInterval(function () {
progress = _this.numFilesSync(rootPath + "_app-extract");
if (progress >= total)
clearInterval(intervalId);
modalDiv.setInfo("Extracted " + progress + " of " + total + ".");
}, 500);
}, 50);
break;
asar.createPackage(`${WORK_APP_PATH}/`, WORK_ASAR_PATH, error => {
if (error) {
done(error);
} else {
const asarList = asar.listPackage(WORK_ASAR_PATH);
fs.renameSync(WORK_ASAR_PATH, `${WORK_ASAR_PATH}_`);
let list = filelist.getSync(WORK_VSCE_PATH)
.reduce((list, stats) => {
if (stats.isFile()) {
list.push(pathUtil.relative(WORK_VSCE_PATH, stats.fullPath));
}
return list;
}, []);
fs.writeFileSync(pathUtil.join(WORK_PATH, `publish-files-${PACKAGE_JSON.version}.txt`),
`asar l app.asar\n\n${asarList.join('\n')}\n\n` +
`vsce ls\n\n${list.join('\n')}\n`);
done();
}
});
});
load(archive) {
const archived_files = asar.listPackage(archive);
logger.debug(`Files in ASAR archive: ${archived_files}`);
for (const file of archived_files) {
if(file.startsWith(`${path.sep}node_modules`)) continue;
const f = file.startsWith(path.sep) ? file.substr(1) : file;
switch (extension(f)) {
case 'json':
if (f.toLowerCase().indexOf('package.json') < 0)
continue;
case 'js':
case 'jsx':
case 'ts':
case 'tsx':
case 'htm':
case 'html':