Skip to content

Commit

Permalink
Move and rename to prepareWrite.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JonAbrams committed Dec 28, 2014
1 parent b447d5e commit 21d7528
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/dest/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

var through2 = require('through2');
var prepDestAndResponse = require('../common').prepDestAndResponse;
var prewrite = require('../prepareWrite');

var writeContents = require('./writeContents');


function dest(outFolder, opt) {
function saveFile (file, enc, cb) {
prepDestAndResponse(outFolder, file, opt, function (err, writePath) {
prewrite(outFolder, file, opt, function (err, writePath) {
if (err) {
return cb(err);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/common/index.js → lib/prepareWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var path = require('path');
var mkdirp = require('mkdirp');
var fs = require('graceful-fs');

exports.prepDestAndResponse = function (outFolder, file, opt, cb) {
module.exports = function (outFolder, file, opt, cb) {
opt = opt || {};

var options = assign({
Expand Down
4 changes: 2 additions & 2 deletions lib/symlink/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

var through2 = require('through2');
var fs = require('graceful-fs');
var prepDestAndResponse = require('../common').prepDestAndResponse;
var prewrite = require('../prepareWrite');

function symlink(outFolder, opt) {
function linkFile (file, enc, cb) {
var srcPath = file.path;

prepDestAndResponse(outFolder, file, opt, function (err, writePath) {
prewrite(outFolder, file, opt, function (err, writePath) {
fs.symlink(srcPath, writePath, function (err) {
if (err && err.code !== 'EEXIST') {
return cb(err);
Expand Down

0 comments on commit 21d7528

Please sign in to comment.