jenkins测试

This commit is contained in:
aixianling
2023-03-16 10:05:58 +08:00
parent 47d33a0f63
commit 469737fdd7

View File

@@ -3,10 +3,8 @@ const axios = require("axios");
let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: 'wxwork'}
const saveApps = app => {
console.log(app)
if (app.list.length > 0) {
return axios.post("http://192.168.1.87:12525/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => {
console.log(res)
if (res.data.code == 0) chalkTag.done("产品库目录已同步至后台数据库...")
}).catch(err => {
chalkTag.error(err)
@@ -14,7 +12,6 @@ const saveApps = app => {
}
}
const getFileInfo = (app, file) => {
console.log(app, file)
let vue = fs.readFileSync(file).toString()
if (/appName/.test(vue)) {
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1')
@@ -40,7 +37,7 @@ const getFileInfo = (app, file) => {
const start = () => {
chalkTag.info('开始同步数据到数据库')
Promise.all([
findPages('src/components/pages', file => {
findPages('../src/components/pages', file => {
if (/.+\\[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/')
@@ -48,7 +45,7 @@ const start = () => {
return getFileInfo(app, file)
}
}),
findPages('./src/apps', file => {
findPages('../src/apps', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
@@ -57,7 +54,7 @@ const start = () => {
return getFileInfo(app, file)
}
}),
findPages('src/project', file => {
findPages('../src/project', file => {
if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) {
let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),