Commit 905c3677 authored by nano's avatar nano

debug

parent d8b7b157
This diff is collapsed.
...@@ -7,7 +7,7 @@ export default { ...@@ -7,7 +7,7 @@ export default {
upload_path: path.join(__dirname, './test/upload'), upload_path: path.join(__dirname, './test/upload'),
download_path: path.join(__dirname, './test/release/downloads'), download_path: path.join(__dirname, './test/release/downloads'),
new_apps_json: `${baseUrl}/v2/apps`, new_apps_json: `${baseUrl}/v2/apps`,
upload_url: `${baseUrl}/v1/upload/packageUrl`, upload_url: `${testUrl}/v1/upload/packageUrl`,
old_apps_json: 'https://api.moecube.com/apps.json', old_apps_json: 'https://api.moecube.com/apps.json',
new_package: `${baseUrl}/v1/package/`, new_package: `${baseUrl}/v1/package/`,
new_app: (appId) => `${baseUrl}/v1/app/${appId}`, new_app: (appId) => `${baseUrl}/v1/app/${appId}`,
......
import axios from 'axios'; import axios from 'axios';
import config from './config'; import config from './config';
import * as uuid from 'uuid'; import * as uuid from 'uuid';
import * as _ from 'lodash';
import {XmlDocument} from 'xmldoc'; import {XmlDocument} from 'xmldoc';
...@@ -107,20 +106,26 @@ async function main() { ...@@ -107,20 +106,26 @@ async function main() {
newApps.data.map(app => { newApps.data.map(app => {
apps[app['id']] = app; apps[app['id']] = app;
}) });
try { try {
for (let app of data) { for (let app of data) {
if (!['ygopro', 'desmume', 'test'].includes(app['id']) && !apps[app['id']]) { if (!['ygopro', 'desmume', 'test'].includes(app['id']) && !apps[app['id']]) {
await createApp(app) await createApp(app);
} }
} }
for (let app of _.sampleSize(data, 1)) { for (let app of data) {
if (['ygopro', 'desmume', 'test'].includes(app['id'])) { if (['th10'].includes(app['id'])) {
await updateApp(app); await updateApp(app);
} }
} }
// for (let app of _.sampleSize(data, 1)) {
// if (!['ygopro', 'desmume', 'test'].includes(app['id'])) {
// await updateApp(app);
// }
// }
} catch (e) { } catch (e) {
console.trace(e); console.trace(e);
} }
......
...@@ -184,7 +184,7 @@ const uploadPackageUrl = async (ctx: Context) => { ...@@ -184,7 +184,7 @@ const uploadPackageUrl = async (ctx: Context) => {
// 上传完,干掉本地目录 // 上传完,干掉本地目录
await fs.removeAsync(bundled.distPath); await fs.removeAsync(bundled.distPath);
} catch (e) { } catch (e) {
console.log(e); console.trace(e);
pack!.status = 'failed'; pack!.status = 'failed';
await pack!.save(); await pack!.save();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment