mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 11:39:03 +08:00
fix: 处理手动删除 Gist 之后, Sub-Store 侧重新同步的逻辑
This commit is contained in:
parent
6f7fe8204b
commit
2586c29746
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.298",
|
||||
"version": "2.14.299",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -253,7 +253,25 @@ async function syncToGist(files) {
|
||||
key: ARTIFACT_REPOSITORY_KEY,
|
||||
syncPlatform,
|
||||
});
|
||||
return manager.upload(files);
|
||||
const res = await manager.upload(files);
|
||||
let body = {};
|
||||
try {
|
||||
body = JSON.parse(res.body);
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (e) {}
|
||||
|
||||
const url = body?.html_url ?? body?.web_url;
|
||||
const settings = $.read(SETTINGS_KEY);
|
||||
if (url) {
|
||||
$.log(`同步 Gist 后, 找到 Sub-Store Gist: ${url}`);
|
||||
settings.artifactStore = url;
|
||||
settings.artifactStoreStatus = 'VALID';
|
||||
} else {
|
||||
$.error(`同步 Gist 后, 找不到 Sub-Store Gist`);
|
||||
settings.artifactStoreStatus = 'NOT FOUND';
|
||||
}
|
||||
$.write(settings, SETTINGS_KEY);
|
||||
return res;
|
||||
}
|
||||
|
||||
export { syncToGist };
|
||||
|
@ -135,9 +135,9 @@ export default class Gist {
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(`result`, result);
|
||||
console.log(`files`, files);
|
||||
console.log(`actions`, actions);
|
||||
// console.log(`result`, result);
|
||||
// console.log(`files`, files);
|
||||
// console.log(`actions`, actions);
|
||||
|
||||
if (this.syncPlatform === 'gitlab') {
|
||||
if (Object.keys(result).length === 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user