"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/mksnapshot/lib/main.js" (8 Mar 2017, 809 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 (function() {
    2   var callMksnapshot, getPathOfMksnapshot, mksnapshot, stripVersion;
    3 
    4   callMksnapshot = require('./mksnapshot-call');
    5 
    6   getPathOfMksnapshot = require('./mksnapshot-path');
    7 
    8   stripVersion = function(version) {
    9     var versions;
   10     if (version[0] === 'v') {
   11       version = version.substr(1);
   12     }
   13     versions = version.split('.');
   14     versions[2] = '0';
   15     return versions.join('.');
   16   };
   17 
   18   mksnapshot = function(content, target, version, arch, builddir, callback) {
   19     version = stripVersion(version);
   20     return getPathOfMksnapshot(version, arch, builddir, function(error, mksnapshot) {
   21       if (error) {
   22         return callback(error);
   23       }
   24       return callMksnapshot(mksnapshot, content, target, builddir, callback);
   25     });
   26   };
   27 
   28   module.exports = mksnapshot;
   29 
   30 }).call(this);