Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevitools.js
More file actions
Latest commit
64 lines (56 loc) · 1.62 KB
/
Copy pathdevitools.js
File metadata and controls
64 lines (56 loc) · 1.62 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
constPath=require('path')
/**
* @param command
* @param {string} pwd
* @param {string} name
* @param {string} short
* @private
*/
asyncfunctionupdate(command,pwd,name,short){
constfiles=[
'.environment/stage/docker-compose.yml',
'.tevun/hooks/install.sh',
'.tevun/hooks/setup.sh',
'frontend/public/statics/site.webmanifest',
'frontend/.env.defaults',
'frontend/.env.example',
'frontend/package.json',
'frontend/quasar.conf.js',
'backend/.env.defaults',
'backend/.env.example',
'backend/composer.json',
'backend/docker-compose.yml.example',
'backend/makefile',
'.devitools.json',
]
for(constfileoffiles){
constfilename=Path.resolve(pwd,file)
conststring=String(command.readFile(filename))
constcontent=string
.replace(/replace\.app\.name/g,name)
.replace(/replace\.app\.short/g,short)
command.writeFile(filename,content)
}
}
/**
* @param command
* @param pwd
* @param options
* @return {Promise<void>}
*/
module.exports=asyncfunction(command,pwd,options){
command.unlink(Path.resolve(pwd,'.git'))
command.unlink(Path.resolve(pwd,'frontend/@devitools'))
command.unlink(Path.resolve(pwd,'backend/@devitools'))
const{ name, short, git }=options
awaitupdate(command,pwd,name,short)
returngit
.init()
.checkoutLocalBranch('main')
.add('.devitools.json')
.commit('(main)')
.submoduleAdd('https://github.com/devitools/quasar','./frontend/@devitools')
.submoduleAdd('https://github.com/devitools/laravel','./backend/@devitools')
.add('.')
.commit('(init)')
}