Skip to content

Commit

Permalink
script dump support
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcat101 committed Jul 18, 2023
1 parent 9433b05 commit d69b488
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
let pkgname = ""
let pkginfo
let branch
let path
let regname
let search = false
Expand Down Expand Up @@ -40,12 +41,15 @@
pkgname = window.location.hash.substring(1);
if (!Object.keys(packages).includes(pkgname)) pkginfo = "404";
else {
regname = packages[pkgname].split("@")[0];
regname = packages[pkgname].split("@")[0].split("$")[0];
branch = packages[pkgname].includes("@")
? packages[pkgname].split("@").at(-1)
: "main";
path = packages[pkgname].includes("$")
? packages[pkgname].split("@")[0].split("$").at(-1)
: null
fetch(
`https://raw.githubusercontent.com/${regname}/${branch}/.kjspkg`
`https://raw.githubusercontent.com/${regname}/${branch}${path!=null ? "/"+path : ""}/.kjspkg`
).then((i) => {
i.json().then((info) => {
pkginfo = info;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/info.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
let getdepsandincompats = arr => {
let newarr = []
arr.forEach(i => {
if (i.includes(":")) newarr.push(prettify(`${i.split(":").at(-1)} (${i.split(":")[0]})`))
else newarr.push(prettify(i))
if (i.includes(":")) newarr.push(prettify(`${i.split(":").at(-1).replaceAll("-", " ").replaceAll("_", " ")} (${i.split(":")[0]})`))
else newarr.push(prettify(i.replaceAll("-", " ").replaceAll("_", " ")))
})
return newarr.join(", ")
}
Expand Down

0 comments on commit d69b488

Please sign in to comment.