mirror of
https://github.com/sourcey/spectacle.git
synced 2024-09-11 05:25:36 +03:00
Switched to creating a custom temporary directory per-run, instead of re-using the same cache.
This commit is contained in:
parent
2ece7a0d57
commit
0ffde26db3
@ -1,12 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var program = require('commander'),
|
||||
tmp = require('tmp'),
|
||||
fs = require('fs'),
|
||||
os = require('os'),
|
||||
path = require('path'),
|
||||
package = require('../package'),
|
||||
spectacle = require('../index.js');
|
||||
|
||||
// Ensures temporary files are cleaned up on program close, even if errors are encountered.
|
||||
tmp.setGracefulCleanup();
|
||||
|
||||
var cwd = process.cwd(),
|
||||
root = path.resolve(__dirname, '..');
|
||||
|
||||
@ -35,8 +39,8 @@ if (program.args.length < 1) { // && program.rawArgs.length < 1
|
||||
program.help();
|
||||
}
|
||||
|
||||
// Set some necessary defaults
|
||||
program.cacheDir = os.tmpdir() + '/.spectacle';
|
||||
// Create a new temporary directory, and set some necessary defaults
|
||||
program.cacheDir = tmp.dirSync({ unsafeCleanup: true, prefix: 'spectacle-' });
|
||||
program.specFile = program.args[0]; // || path.resolve(root, 'test/fixtures/cheese.json');
|
||||
|
||||
// Replace some absolute paths
|
||||
|
@ -44,7 +44,6 @@
|
||||
"grunt-contrib-handlebars": "^0.11.0",
|
||||
"grunt-contrib-uglify": "^0.11.0",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-contrib-copy": "^0.8.2",
|
||||
"grunt-prettify": "^0.4.0",
|
||||
"grunt-sass": "^2.0.0",
|
||||
"handlebars": "^4.0.5",
|
||||
@ -52,6 +51,7 @@
|
||||
"json-stable-stringify": "^1.0.1",
|
||||
"lodash": "^4.2.1",
|
||||
"marked": "^0.3.5",
|
||||
"tmp": "0.0.31",
|
||||
"trace": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user