|
1 | 1 | let glob = require("glob"); |
2 | | -let fs = require('fs'); |
3 | | -const path = require("path") |
| 2 | +let fs = require("fs"); |
| 3 | +const path = require("path"); |
4 | 4 |
|
5 | 5 | function globUpdater(er, files) { |
6 | | - |
7 | | - if (er) |
8 | | - console.log(files, 'glob resolving issue') |
| 6 | + if (er) console.log(files, "glob resolving issue"); |
9 | 7 | else |
10 | | - files.forEach(filename => { |
11 | | - |
12 | | - console.log(filename + '/manual.yml', 'glob resolving issue') |
13 | | - update(filename + '/manual.yml') |
14 | | - }) |
15 | | - |
| 8 | + files.forEach((filename) => { |
| 9 | + console.log(filename + "/manual.yml", "glob resolving issue"); |
| 10 | + update(filename + "/manual.yml"); |
| 11 | + }); |
16 | 12 | } |
17 | 13 |
|
18 | | - |
19 | | - |
20 | | - |
21 | 14 | function update(Path) { |
22 | 15 | // component name |
23 | | - let name = path.basename(path.resolve(path.dirname(Path), '../..')).substring(9); |
| 16 | + let name = path |
| 17 | + .basename(path.resolve(path.dirname(Path), "../..")) |
| 18 | + .substring(9); |
24 | 19 | let fileContent = `name: Manual Workflow |
25 | 20 | on: |
26 | 21 | workflow_dispatch: |
@@ -68,24 +63,19 @@ jobs: |
68 | 63 |
|
69 | 64 | `; |
70 | 65 |
|
71 | | - |
72 | | - if (fs.existsSync(Path)) |
73 | | - fs.unlinkSync(Path) |
74 | | - fs.writeFileSync(Path, fileContent) |
75 | | - |
| 66 | + if (fs.existsSync(Path)) fs.unlinkSync(Path); |
| 67 | + fs.writeFileSync(Path, fileContent); |
76 | 68 | } |
77 | 69 |
|
78 | | - |
79 | | - |
80 | | -// glob("../CoCreate-components/CoCreate-action/.github/workflows", globUpdater) |
81 | | -glob("../CoCreate-components/*/.github/workflows/", globUpdater) |
82 | | -glob("../CoCreate-apps/*/.github/workflows/", globUpdater) |
83 | | -glob("../CoCreate-plugins/*/.github/workflows/", globUpdater) |
| 70 | +// glob("../CoCreate-modules/CoCreate-action/.github/workflows", globUpdater) |
| 71 | +glob("../CoCreate-modules/*/.github/workflows/", globUpdater); |
| 72 | +glob("../CoCreate-apps/*/.github/workflows/", globUpdater); |
| 73 | +glob("../CoCreate-plugins/*/.github/workflows/", globUpdater); |
84 | 74 |
|
85 | 75 | // substrin (9) removes CoCreateC leving namme as SS |
86 | 76 | // glob("../CoCreateCSS/.github/workflows/", globUpdater) |
87 | 77 |
|
88 | 78 | // does not need to add name... will require for name to be removed from destination |
89 | 79 | // glob("../CoCreateJS/.github/workflows/", globUpdater) |
90 | 80 |
|
91 | | -console.log('finished') |
| 81 | +console.log("finished"); |
0 commit comments