-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.js
More file actions
25 lines (18 loc) 路 711 Bytes
/
Copy pathsetup.js
File metadata and controls
25 lines (18 loc) 路 711 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
const fs = require('fs')
const path = require('path')
if (fs.existsSync(path.join(__dirname, '.travis.yml'))) {
process.exit()
}
const projectFilesToDelete = ['.flowconfig', 'App.js', '__tests__/App-test.js']
const templateFilesToDelete = ['setup.js', 'README.md', 'LICENSE']
const deleteFile = filePath => {
if (!fs.existsSync(filePath)) {
return
}
fs.unlinkSync(filePath)
}
const projectPath = path.join(__dirname, '..', '..')
const deleteProjectFile = fileName => deleteFile(path.join(projectPath, fileName))
const deleteTemplateFile = fileName => deleteFile(path.join(__dirname, fileName))
projectFilesToDelete.forEach(deleteProjectFile)
templateFilesToDelete.forEach(deleteTemplateFile)