Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) =>
asar.createPackage(
this.$.env.paths.electronApp.meteorApp,
path.join(this.$.env.paths.electronApp.root, 'meteor.asar'),
() => {
// On Windows some files might still be blocked. Giving a tick for them to be
// ready for deletion.
setImmediate(() => {
this.log.verbose('clearing meteor app after packing');
this.$.utils
.rmWithRetries('-rf', this.$.env.paths.electronApp.meteorApp)
.then(() => {
resolve();
})
.catch((e) => {
reject(e);
});
});
router.get("/", function (req, res) {
// only allow for user
if (req.user.check() !== 'GRANTALL') return;
let {name} = req.query;
if (!name) return res.send({err: new Error('not defined name')});
const PRJ_PATH = path.resolve(req.DIR.WORKSPACE_PATH, `${name}.satbook`);
const DOWNLOAD_PATH = path.resolve(req.DIR.TMPD, `download`, `${name}.satbook`);
if (!fs.existsSync(PRJ_PATH)) return res.send({err: new Error('no work')});
asar.createPackage(PRJ_PATH, DOWNLOAD_PATH, function () {
res.download(DOWNLOAD_PATH);
});
});
if (req.user.check() === 'DENIED') return;
if (!req.query.path) return res.send({err: new Error('not defined name')});
let tfolder = `${new Date().getTime()}_${Math.round(Math.random() * 100)}`;
const PRJ_PATH = path.join(req.DIR.WORKSPACE_PATH, req.query.path);
const COPY_PATH = path.join(req.DIR.TMPD, `download`, tfolder, 'copy', req.query.path);
const DOWNLOAD_PATH = path.join(req.DIR.TMPD, `download`, tfolder, req.query.path);
if (fs.existsSync(DOWNLOAD_PATH)) fsext.removeSync(DOWNLOAD_PATH);
if (!fs.existsSync(PRJ_PATH)) return res.send({err: new Error('no work')});
if (!fs.existsSync(path.dirname(DOWNLOAD_PATH))) fsext.mkdirsSync(path.dirname(DOWNLOAD_PATH));
fsext.copySync(PRJ_PATH, COPY_PATH);
core.worker.clean(COPY_PATH);
asar.createPackage(COPY_PATH, DOWNLOAD_PATH, function () {
res.download(DOWNLOAD_PATH);
});
});
var packageBuiltApp = function () {
var deferred = Q.defer();
asar.createPackage(projectDir.path('build'), readyAppDir.path('resources/app.asar'), function() {
deferred.resolve();
});
return deferred.promise;
};
var packageBuiltApp = function () {
var deferred = Q.defer();
asar.createPackage(projectDir.path('build'), finalAppDir.path('Contents/Resources/app.asar'), function() {
deferred.resolve();
});
return deferred.promise;
};
var packageBuiltApp = function () {
var deferred = Q.defer();
asar.createPackage(projectDir.path('build'), finalAppDir.path('Contents/Resources/app.asar'), function() {
deferred.resolve();
});
return deferred.promise;
};
return new Promise ( function ( resolve, reject )
{
asar.createPackage ( projectDir.path('build'), readyAppDir.path('resources/app.asar' ), function ()
{
resolve ( );
} );
} );
}
TileImporter.prototype._createAsar = function (tilesPath, destFile, cb) {
logger.log('creating asar', tilesPath, destFile)
try {
asar.createPackage(tilesPath, destFile).then(cb)
} catch (err) {
logger.error('ERROR(tile-importer): Got error when creating asar', err)
return cb(err)
}
}
var packageBuiltApp = function () {
var deferred = Q.defer();
asar.createPackage(projectDir.path('build'), readyAppDir.path('resources/app.asar'), function () {
deferred.resolve();
});
return deferred.promise;
};
var packageBuiltApp = function() {
var deferred = Q.defer();
asar.createPackage(projectDir.path('build'), readyAppDir.path('resources/app.asar'), function() {
deferred.resolve();
});
return deferred.promise;
};