Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 905fe73

Browse files
authoredJan 18, 2025··
Update release.ts
1 parent 18d0786 commit 905fe73

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed
 

‎tools/release.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fs from 'fs';
22
import path from 'path';
33
import Gitee from '@gitee/typescript-sdk-v5';
4-
import { RepositoriesService } from '@gitee/typescript-sdk-v5/src/services.gen';
54
import { Release } from 'zotero-plugin-scaffold';
65
import loadConfig from './config';
76

@@ -30,9 +29,9 @@ async function main() {
3029
}
3130

3231
async function rewriteRelease(tag: string, name: string, body: string, prerelease = false) {
33-
const old = await RepositoriesService.getV5ReposOwnerRepoReleasesTagsTag({ owner, repo, tag });
32+
const old = await Gitee.RepositoriesService.getV5ReposOwnerRepoReleasesTagsTag({ owner, repo, tag });
3433
if (old?.id)
35-
return RepositoriesService.patchV5ReposOwnerRepoReleasesId({
34+
return Gitee.RepositoriesService.patchV5ReposOwnerRepoReleasesId({
3635
owner,
3736
repo,
3837
name,
@@ -41,7 +40,7 @@ async function rewriteRelease(tag: string, name: string, body: string, prereleas
4140
id: old.id,
4241
tagName: tag,
4342
});
44-
return RepositoriesService.postV5ReposOwnerRepoReleases({
43+
return Gitee.RepositoriesService.postV5ReposOwnerRepoReleases({
4544
owner,
4645
repo,
4746
name,
@@ -53,22 +52,22 @@ async function rewriteRelease(tag: string, name: string, body: string, prereleas
5352
}
5453

5554
async function rewriteAttach(releaseId: number, file: string) {
56-
const assets = await RepositoriesService.getV5ReposOwnerRepoReleasesReleaseIdAttachFiles({
55+
const assets = await Gitee.RepositoriesService.getV5ReposOwnerRepoReleasesReleaseIdAttachFiles({
5756
owner,
5857
repo,
5958
releaseId,
6059
}), fileBuffer = fs.readFileSync(file);
6160
for (const asset of assets)
6261
if (asset.name == path.basename(file))
63-
await RepositoriesService
62+
await Gitee.RepositoriesService
6463
.deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId({
6564
owner,
6665
repo,
6766
releaseId,
6867
attachFileId: asset.id!,
6968
})
7069
.catch(console.error);
71-
RepositoriesService.postV5ReposOwnerRepoReleasesReleaseIdAttachFiles({
70+
Gitee.RepositoriesService.postV5ReposOwnerRepoReleasesReleaseIdAttachFiles({
7271
owner,
7372
repo,
7473
releaseId,

0 commit comments

Comments
 (0)
Please sign in to comment.