1 | "use strict";
|
2 |
|
3 | var fs = require("fs"),
|
4 | path = require("path"),
|
5 | glob = require("glob"),
|
6 | opts = {
|
7 | cwd: path.join(__dirname, "..", "brackets-srv")
|
8 | };
|
9 |
|
10 | glob("**/node_modules_", opts, function (err, files) {
|
11 | if (err) {
|
12 | throw err;
|
13 | }
|
14 |
|
15 | if (files) {
|
16 | files.sort(function (a, b) {
|
17 | return b.length - a.length;
|
18 | });
|
19 |
|
20 | files.forEach(function (file) {
|
21 | file = path.join(opts.cwd, file);
|
22 | fs.renameSync(file, file.substr(0, file.length - 1));
|
23 | console.log("file: " + file.substr(0, file.length - 1));
|
24 | });
|
25 | }
|
26 | });
|