Skip to content

Commit

Permalink
feat: 日志中增加上传配置的响应
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 9, 2025
1 parent 01eb69d commit f96d9de
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.16.7",
"version": "2.16.8",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions backend/src/products/cron-sync-artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ async function doSync() {

const resp = await syncToGist(files);
const body = JSON.parse(resp.body);
delete body.history;
delete body.forks;
delete body.owner;
Object.values(body.files).forEach((file) => {
delete file.content;
});
$.info('上传配置响应:');
$.info(JSON.stringify(body, null, 2));

for (const artifact of allArtifacts) {
if (artifact.sync) {
Expand Down
19 changes: 19 additions & 0 deletions backend/src/restful/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,15 @@ async function syncArtifacts() {
const resp = await syncToGist(files);
const body = JSON.parse(resp.body);

delete body.history;
delete body.forks;
delete body.owner;
Object.values(body.files).forEach((file) => {
delete file.content;
});
$.info('上传配置响应:');
$.info(JSON.stringify(body, null, 2));

for (const artifact of allArtifacts) {
if (artifact.sync) {
artifact.updated = new Date().getTime();
Expand Down Expand Up @@ -743,6 +752,16 @@ async function syncArtifact(req, res) {
});
artifact.updated = new Date().getTime();
const body = JSON.parse(resp.body);

delete body.history;
delete body.forks;
delete body.owner;
Object.values(body.files).forEach((file) => {
delete file.content;
});
$.info('上传配置响应:');
$.info(JSON.stringify(body, null, 2));

let files = body.files;
let isGitLab;
if (Array.isArray(files)) {
Expand Down

0 comments on commit f96d9de

Please sign in to comment.