diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-14 11:10:08 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-14 11:10:08 +0100 |
commit | a65f888a77c48968087d23750e5fa4d55f2a8686 (patch) | |
tree | b88e7e5b0e98ae791726586592716cd602355abf /lib/utils/fs.js | |
parent | 71059e3ea3ea9af156987a0dd4cb0a5457b0316c (diff) | |
download | gitbook-a65f888a77c48968087d23750e5fa4d55f2a8686.zip gitbook-a65f888a77c48968087d23750e5fa4d55f2a8686.tar.gz gitbook-a65f888a77c48968087d23750e5fa4d55f2a8686.tar.bz2 |
Start moving template and conrefs on Output
Diffstat (limited to 'lib/utils/fs.js')
-rw-r--r-- | lib/utils/fs.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils/fs.js b/lib/utils/fs.js index c0ff0c9..840d1f9 100644 --- a/lib/utils/fs.js +++ b/lib/utils/fs.js @@ -61,6 +61,12 @@ function genTmpFile(opts) { .get(0); } +// Generate temporary dir +function genTmpDir(opts) { + return Promise.nfcall(tmp.dir, opts) + .get(0); +} + // Download an image function download(uri, dest) { return writeStream(dest, request(uri)); @@ -101,6 +107,7 @@ module.exports = { writeStream: writeStream, copy: copyFile, tmpFile: genTmpFile, + tmpDir: genTmpDir, download: download, uniqueFilename: uniqueFilename, ensure: ensureFile |