Skip to content

Commit

Permalink
Fix whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Oct 11, 2016
1 parent e1759fe commit 4a0bd79
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ var tmp = require("tmp");
var Promise = require("bluebird");


// file
// file
module.exports.fileSync = tmp.fileSync;
var file = Promise.promisify(tmp.file, {multiArgs: true});

module.exports.file = function file$promise() {
return file.apply(tmp, arguments).spread(function (path, fd, cleanup) {
return {path: path, fd: fd, cleanup : cleanup };
Expand All @@ -13,16 +14,18 @@ module.exports.file = function file$promise() {

module.exports.withFile = function withFile(fn) {
var cleanup;
return module.exports.file.apply(tmp).then(function context(o) {
return module.exports.file.apply(tmp).then(function context(o) {
cleanup = o.cleanup;
delete o.cleanup;
return fn(o);
}).finally(cleanup);
};

// directory

// directory
module.exports.dirSync = tmp.dirSync;
var dir = Promise.promisify(tmp.dir, {multiArgs: true});

module.exports.dir = function dir$promise() {
return dir.apply(tmp, arguments).spread(function (path, cleanup) {
return {path: path, cleanup: cleanup};
Expand All @@ -31,19 +34,18 @@ module.exports.dir = function dir$promise() {

module.exports.withDir = function withDir(fn) {
var cleanup;
return module.exports.dir.apply(tmp, arguments).then(function context(o) {
return module.exports.dir.apply(tmp, arguments).then(function context(o) {
cleanup = o.cleanup;
delete o.cleanup;
return fn(o);
}).finally(cleanup);
};


// name generation
module.exports.tmpNameSync = tmp.tmpNameSync;
module.exports.tmpName = Promise.promisify(tmp.tmpName);


module.exports.tmpdir = tmp.tmpdir;


module.exports.setGracefulCleanup = tmp.setGracefulCleanup;

0 comments on commit 4a0bd79

Please sign in to comment.