增加下来开关的检测
This commit is contained in:
@@ -3,16 +3,19 @@ const {chalkTag, findPages, fs, fsExtra} = require("./tools");
|
|||||||
let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: 'wxwork'}
|
let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: 'wxwork'}
|
||||||
const getFileInfo = (app, file) => {
|
const getFileInfo = (app, file) => {
|
||||||
let vue = fs.readFileSync(file).toString()
|
let vue = fs.readFileSync(file).toString()
|
||||||
|
//获取模块名称
|
||||||
if (/appName/.test(vue)) {
|
if (/appName/.test(vue)) {
|
||||||
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1')
|
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1')
|
||||||
app.label = appName.replace(/(appName:|["'])/g, '').trim()
|
app.label = appName.replace(/(appName:|["'])/g, '').trim()
|
||||||
|
}
|
||||||
|
// 处理页面自定义选项
|
||||||
if (/customNavigation/.test(vue)) {
|
if (/customNavigation/.test(vue)) {
|
||||||
app.style = {navigationStyle: "custom"}
|
app.style = {navigationStyle: "custom"}
|
||||||
} else app.style = {navigationBarTitleText: app.label}
|
} else app.style = {navigationBarTitleText: app.label}
|
||||||
if (/enablePullDownRefresh/.test(vue)) {
|
if (/enablePullDownRefresh/.test(vue)) {
|
||||||
app.style.enablePullDownRefresh = true
|
app.style.enablePullDownRefresh = true
|
||||||
}
|
}
|
||||||
}
|
// 处理和统计模块应用数据
|
||||||
if (/^App/.test(app.name) && app.label) {
|
if (/^App/.test(app.name) && app.label) {
|
||||||
let {name, label} = app,
|
let {name, label} = app,
|
||||||
path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`)
|
path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`)
|
||||||
|
|||||||
Reference in New Issue
Block a user