mirror of
https://github.com/S2-/gitlit
synced 2025-08-04 05:10:05 +02:00
add node modules to repo
This commit is contained in:
37
node_modules/mksnapshot/lib/mksnapshot-call.js
generated
vendored
Normal file
37
node_modules/mksnapshot/lib/mksnapshot-call.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
(function() {
|
||||
var callMksnapshot, fs, path, spawn;
|
||||
|
||||
fs = require('fs-extra');
|
||||
|
||||
path = require('path');
|
||||
|
||||
spawn = require('child_process').spawn;
|
||||
|
||||
callMksnapshot = function(mksnapshot, content, target, builddir, callback) {
|
||||
return fs.writeFile(path.join(builddir, 'out.js'), content, function(error) {
|
||||
var child;
|
||||
if (error) {
|
||||
return callback(error);
|
||||
}
|
||||
child = spawn(mksnapshot, ['out.cc', '--startup_blob', 'out.bin', 'out.js'], {
|
||||
cwd: builddir
|
||||
});
|
||||
child.on('error', callback);
|
||||
return child.on('close', function(code) {
|
||||
if (code !== 0) {
|
||||
return callback(new Error("mksnapshot returned " + code));
|
||||
}
|
||||
try {
|
||||
fs.copySync(path.join(builddir, 'out.bin'), target);
|
||||
} catch (_error) {
|
||||
error = _error;
|
||||
return callback(error);
|
||||
}
|
||||
return callback(null);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = callMksnapshot;
|
||||
|
||||
}).call(this);
|
Reference in New Issue
Block a user