Skip to content

Commit e0180bb

Browse files
committed
fix: version check
1 parent d5dd302 commit e0180bb

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.changes/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"pkgManagers": {
1111
"rust": {
1212
"version": true,
13-
"getPublishedVersion": "node scripts/version-check.mjs ${ pkg.pkg } ${ pkg.pkgFile.version }",
13+
"getPublishedVersion": "node scripts/version-check.mjs",
1414
"publish": []
1515
}
1616
},

scripts/version-check.mjs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import axios from "axios";
22

3-
const pkg = process.argv[2];
4-
const version = process.argv[3];
5-
63
axios
74
.get(
8-
`https://api.github.com/repos/swpu-acm/algohub/git/refs/tags/${pkg}-v${version}`
5+
`https://api.github.com/repos/swpu-acm/algohub/git/refs/tags/`
96
)
107
.then((response) => {
11-
const data = JSON.parse(response.data);
12-
console.log(data[data.length - 1].ref.split("-")[1]);
8+
const data = response.data;
9+
console.log(data[data.length - 1].ref.split("-v")[1]);
1310
})
1411
.catch((error) => {
1512
console.error(error.data);

src-tauri/Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)