mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
修改版本信息获取
This commit is contained in:
parent
23bda39812
commit
7b2c54f6a6
|
@ -9,6 +9,7 @@ import ScheduleService from './schedule';
|
||||||
import { spawn } from 'child_process';
|
import { spawn } from 'child_process';
|
||||||
import SockService from './sock';
|
import SockService from './sock';
|
||||||
import got from 'got';
|
import got from 'got';
|
||||||
|
import { promiseExec } from '../config/util';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export default class SystemService {
|
export default class SystemService {
|
||||||
|
@ -87,10 +88,9 @@ export default class SystemService {
|
||||||
let lastVersion = '';
|
let lastVersion = '';
|
||||||
let lastLog = '';
|
let lastLog = '';
|
||||||
try {
|
try {
|
||||||
const result = await got.get(config.lastVersionFile, {
|
const lastVersionFileContent = await promiseExec(
|
||||||
timeout: 30000,
|
`curl ${config.lastVersionFile}`,
|
||||||
});
|
);
|
||||||
const lastVersionFileContent = result.body;
|
|
||||||
lastVersion = lastVersionFileContent.match(versionRegx)![1];
|
lastVersion = lastVersionFileContent.match(versionRegx)![1];
|
||||||
lastLog = lastVersionFileContent.match(logRegx)
|
lastLog = lastVersionFileContent.match(logRegx)
|
||||||
? lastVersionFileContent.match(logRegx)![1]
|
? lastVersionFileContent.match(logRegx)![1]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user