UNPKG

771 BJavaScriptView Raw
1"use strict";
2
3var fs = require("fs"),
4 path = require("path"),
5 glob = require("glob"),
6 opts = {
7 cwd: path.join(__dirname, "..", "brackets-srv")
8 },
9 conts = fs.readFileSync("install.log", { encoding: "utf8" });
10
11if (!conts) {
12 glob("**/node_modules", opts, function (err, files) {
13 if (err) {
14 throw err;
15 }
16
17 if (files) {
18 files.sort(function (a, b) {
19 return b.length - a.length;
20 });
21
22 files.forEach(function (file) {
23 file = path.join(opts.cwd, file);
24 fs.renameSync(file, file + "_");
25 console.log("file: " + file + "_");
26 });
27 }
28 });
29}
30fs.writeFileSync("install.log", "");