Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
37
gaia/tests/jsmarionette/runner/mozilla-profile-builder/lib/tmpdir.js
Executable file
37
gaia/tests/jsmarionette/runner/mozilla-profile-builder/lib/tmpdir.js
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
var tmp = require('tmp');
|
||||
|
||||
// https://github.com/mozilla-b2g/mozilla-profile-builder/issues/2
|
||||
process.on('SIGINT', function() {});
|
||||
|
||||
/**
|
||||
* Wrapper around common tmp dir creation functionality.
|
||||
*
|
||||
* Options:
|
||||
* - (Boolean) keep: when true profile will not be removed on process close.
|
||||
*
|
||||
* @param {Object} options for tmp dir creation.
|
||||
* @param {Function} callback for tmp dir creation.
|
||||
*/
|
||||
function tmpdir(options, callback) {
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
// configuration for temp directory
|
||||
// https://github.com/raszi/node-tmp#options
|
||||
var tmpConfig = {};
|
||||
if (options && options.keep) {
|
||||
// keep directory for later
|
||||
tmpConfig.keep = true;
|
||||
} else {
|
||||
// discard directory when process closes.
|
||||
tmpConfig.unsafeCleanup = true;
|
||||
tmpConfig.keep = false;
|
||||
}
|
||||
|
||||
tmp.dir(tmpConfig, callback);
|
||||
}
|
||||
|
||||
module.exports = tmpdir;
|
||||
Loading…
Reference in a new issue