forked from electron/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.js
More file actions
executable file
·21 lines (19 loc) · 853 Bytes
/
Copy pathclean.js
File metadata and controls
executable file
·21 lines (19 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Clean up any files left behind by removed apps.
//
// When someone submits a PR to remove an app, only the `foo.yml` and `foo-icon.png`
// files are present in the repo. This script cleans up any leftover local
// artifacts that were created by `npm run build`, such as `apps/foo-icon-128.png`
const fs = require('fs');
const path = require('path');
fs.readdirSync(path.join(__dirname, '../apps'))
.filter((filename) => {
return fs.statSync(path.join(__dirname, `../apps/${filename}`)).isDirectory();
})
.filter((filename) => {
return !fs.existsSync(path.join(__dirname, `../apps/${filename}/${filename}.yml`));
})
.forEach((filename) => {
const appDir = path.join(__dirname, `../apps/${filename}`);
console.log(`Removing leftover artifacts from ${appDir}`);
fs.rmSync(appDir, { recursive: true, force: true });
});