Comparing version 0.0.13 to 0.0.14
@@ -15,12 +15,13 @@ "use strict"; | ||
Object.keys(json.publishr.files).forEach(function (key) { | ||
_fs2.default.readFile(json.publishr.files[key], "utf8", function (readErr, contents) { | ||
var oldFilePath = json.publishr.files[key]; | ||
var newFilePath = key; | ||
_fs2.default.readFile(oldFilePath, "utf8", function (readErr, contents) { | ||
if (readErr) { | ||
console.log("READ ERROR FILES"); | ||
return; | ||
throw new Error("READ ERROR: " + oldFilePath); | ||
} | ||
_fs2.default.writeFile(key, contents, "utf8", function (writeErr) { | ||
_fs2.default.writeFile(newFilePath, contents, "utf8", function (writeErr) { | ||
if (writeErr) { | ||
console.log("WRITE ERROR FILES"); | ||
throw new Error("WRITE ERROR ${newFilePath}"); | ||
} | ||
@@ -33,3 +34,3 @@ }); | ||
if (writeErr) { | ||
console.log("WRITE ERROR FILES"); | ||
throw new Error("WRITE ERROR: package.json"); | ||
} | ||
@@ -36,0 +37,0 @@ }); |
@@ -7,12 +7,12 @@ "use strict"; | ||
var _child_process = require("child_process"); | ||
var _fixFiles = require("./fix-files"); | ||
var _fixFiles2 = _interopRequireDefault(_fixFiles); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var postpublish = function postpublish() { | ||
(0, _child_process.exec)("git clean -df && git checkout .", function (err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
}); | ||
(0, _fixFiles2.default)(); | ||
}; | ||
exports.default = postpublish; |
@@ -24,5 +24,3 @@ "use strict"; | ||
if (readErr) { | ||
console.log("READ ERROR"); | ||
return; | ||
throw new Error("READ ERROR: package.json"); | ||
} | ||
@@ -29,0 +27,0 @@ |
{ | ||
"name": "publishr", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "A tool for harmonious publishing of git and npm packages.", | ||
@@ -5,0 +5,0 @@ "bin": { |
6233
9
108