调整工程目录

This commit is contained in:
aixianling
2022-02-16 15:10:40 +08:00
parent 28be9ca0c5
commit f52b8f94e2
33 changed files with 58 additions and 53 deletions

View File

@@ -81,8 +81,21 @@ const start = () => {
}
json.pages.push(app)
}
}).then(() => {
return findApp('src/apps', file => {
}).then(() => findApp('src/apps', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/')
}
let vue = fs.readFileSync(file).toString()
if (/appName/.test(vue)) {
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1'),
title = appName.replace(/(appName:|["'])/g, '')
app.style = {navigationBarTitleText: title}
}
json.pages.push(app)
}
})).then(() => findApp('src/saas', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
@@ -96,26 +109,23 @@ const start = () => {
}
json.pages.push(app)
}
}).then(() => {
return findApp('src/saas', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/')
}
let vue = fs.readFileSync(file).toString()
if (/appName/.test(vue)) {
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1'),
title = appName.replace(/(appName:|["'])/g, '')
app.style = {navigationBarTitleText: title}
}
json.pages.push(app)
})).then(() => findApp('src/project', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/')
}
})
}).then(() => {
fsExtra.outputJson('src/pages.json', json, () => {
chalkTag.done('生成pages.json')
})
let vue = fs.readFileSync(file).toString()
if (/appName/.test(vue)) {
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1'),
title = appName.replace(/(appName:|["'])/g, '')
app.style = {navigationBarTitleText: title}
}
json.pages.push(app)
}
})).then(() => {
fsExtra.outputJson('src/pages.json', json, () => {
chalkTag.done('生成pages.json')
})
})