修复任务详情日志访问,修复新建订阅粘贴repo命令

This commit is contained in:
whyour
2022-05-28 17:36:41 +08:00
parent b3ed824b2e
commit 31ff0476a6
4 changed files with 17 additions and 8 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ export default (app: Router) => {
try {
const filePath = join(
config.logPath,
req.query.path as string,
(req.query.path || '') as string,
req.params.file,
);
const content = getFileContentByName(filePath);
+6 -4
View File
@@ -181,8 +181,9 @@ export default class SubscriptionService {
if (doc.sub_before) {
beforeStr = execSync(doc.sub_before).toString();
}
} catch (error) {
beforeStr = JSON.stringify(error);
} catch (error: any) {
beforeStr =
(error.stderr && error.stderr.toString()) || JSON.stringify(error);
}
if (beforeStr) {
beforeStr += '\n';
@@ -225,8 +226,9 @@ export default class SubscriptionService {
if (sub.sub_after) {
afterStr = execSync(sub.sub_after).toString();
}
} catch (error) {
afterStr = JSON.stringify(error);
} catch (error: any) {
afterStr =
(error.stderr && error.stderr.toString()) || JSON.stringify(error);
}
if (afterStr) {
afterStr = `\n\n${afterStr}`;