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
·26 lines (24 loc) · 872 Bytes
/
Copy pathclean.js
File metadata and controls
executable file
·26 lines (24 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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')
const rimraf = require('rimraf').sync
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}`)
rimraf(appDir)
})