Ghost/core/test/utils/tempfile.js
vdemedes 05f44c4c64 Add readThemes() utility to get a list of themes
refs #5923
- add read-themes module to get a list of themes
- replace readDirectory() usage with readThemes(), where only themes are needed
- test read-themes
- test read-directory
- test validate-themes
- test parse-package-json
- add tempfile testing utility to generate temporary paths
2015-10-13 15:54:41 +02:00

24 lines
328 B
JavaScript

/**
* Dependencies
*/
var join = require('path').join,
TMP_DIR = require('os').tmpdir();
/**
* Generate a temporary file path
*/
function tempfile() {
var randomString = Math.random().toString(36).substring(7);
return join(TMP_DIR, randomString);
}
/**
* Expose `tempfile`
*/
module.exports = tempfile;