BUG 27200

This commit is contained in:
aixianling
2022-02-11 11:20:57 +08:00
parent fd199ce69f
commit 0045ab1fec
9 changed files with 385 additions and 31 deletions

View File

@@ -68,10 +68,9 @@ const start = () => {
navigationStyle: "custom"
}
}
findApp('src/apps', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
findApp('src/components/pages', file => {
if (/.+\\[^\\]+\\[^\\]+\.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()
@@ -83,7 +82,7 @@ const start = () => {
json.pages.push(app)
}
}).then(() => {
return findApp('src/saas', file => {
return findApp('src/apps', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
@@ -97,12 +96,29 @@ const start = () => {
}
json.pages.push(app)
}
})
}).then(() => {
fsExtra.outputJson('src/pages.json', json, () => {
chalkTag.done('生成pages.json')
}).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(() => {
fsExtra.outputJson('src/pages.json', json, () => {
chalkTag.done('生成pages.json')
})
})
})
}
start();