feat: 支持同步配置时选择包含官方/商店版不支持的协议; 同步配置优化

This commit is contained in:
xream
2024-01-18 06:18:05 +08:00
parent 9bb06bf438
commit 228566116d
4 changed files with 75 additions and 33 deletions

View File

@@ -40,7 +40,7 @@ async function doSync() {
platform: artifact.platform,
});
files[artifact.name] = {
files[encodeURIComponent(artifact.name)] = {
content: output,
};
}
@@ -54,10 +54,9 @@ async function doSync() {
if (artifact.sync) {
artifact.updated = new Date().getTime();
// extract real url from gist
artifact.url = body.files[artifact.name].raw_url.replace(
/\/raw\/[^/]*\/(.*)/,
'/raw/$1',
);
artifact.url = body.files[
encodeURIComponent(artifact.name)
]?.raw_url.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
}
}