How to use the asar.createPackage function in asar

To help you get started, we’ve selected a few asar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wojtkowiak / meteor-desktop / lib / meteorApp.js View on Github external
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);
                            });
                    });
github proin / saturn / controller / express / api / script / import.js View on Github external
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);
    });
});
github proin / saturn / controller / express / api / script / export.js View on Github external
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);
    });
});
github peerplays-network / peerplays-core-gui / electron / tasks / release_linux.js View on Github external
var packageBuiltApp = function () {
    var deferred = Q.defer();

    asar.createPackage(projectDir.path('build'), readyAppDir.path('resources/app.asar'), function() {
        deferred.resolve();
    });

    return deferred.promise;
};
github fxding / greader / tasks / release_osx.js View on Github external
var packageBuiltApp = function () {
    var deferred = Q.defer();

    asar.createPackage(projectDir.path('build'), finalAppDir.path('Contents/Resources/app.asar'), function() {
        deferred.resolve();
    });

    return deferred.promise;
};
github bitshares / bitshares-ui / electron_old / tasks / release_osx.js View on Github external
var packageBuiltApp = function () {
    var deferred = Q.defer();

    asar.createPackage(projectDir.path('build'), finalAppDir.path('Contents/Resources/app.asar'), function() {
        deferred.resolve();
    });

    return deferred.promise;
};
github gaccettola / mortis / client_desktop / source / gulp / release_windows.js View on Github external
return new Promise ( function ( resolve, reject )
    {
        asar.createPackage ( projectDir.path('build'), readyAppDir.path('resources/app.asar' ), function ()
        {
            resolve ( );

        } );

    } );
}
github digidem / mapeo-desktop / src / main / tile-importer.js View on Github external
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)
  }
}
github scimusmn / stele / tasks / release_linux.js View on Github external
var packageBuiltApp = function () {
  var deferred = Q.defer();

  asar.createPackage(projectDir.path('build'), readyAppDir.path('resources/app.asar'), function () {
    deferred.resolve();
  });

  return deferred.promise;
};
github experimentalDataAesthetics / play-splom / tasks / release_windows.js View on Github external
var packageBuiltApp = function() {
  var deferred = Q.defer();

  asar.createPackage(projectDir.path('build'), readyAppDir.path('resources/app.asar'), function() {
    deferred.resolve();
  });

  return deferred.promise;
};

asar

Creating Electron app packages

MIT
Latest version published 2 years ago

Package Health Score

55 / 100
Full package analysis