forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostpublish.js
More file actions
22 lines (19 loc) · 647 Bytes
/
postpublish.js
File metadata and controls
22 lines (19 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Reconfigures the repository after publishing
const fs = require("fs");
const path = require("path");
const devFiles = require("./postpublish-files.json");
console.log("Restoring development files ...");
devFiles.forEach(originalName => {
const backupName = originalName + ".backup";
const backupPath = path.join(__dirname, "..", backupName);
if (!fs.existsSync(backupPath)) {
console.log("- " + backupName + " does not exist");
} else {
console.log("- " + backupName + " -> " + originalName);
fs.copyFileSync(
backupPath,
path.join(__dirname, "..", originalName)
);
fs.unlinkSync(backupPath);
}
});