Fix: wrong paths generated for @local/@preview packages (#30)

This commit is contained in:
Theo Fabi
2023-10-17 16:43:24 -04:00
committed by GitHub
parent 17f44732d4
commit faee30b5d2
2 changed files with 3 additions and 3 deletions

View File

@ -201,7 +201,7 @@ impl SystemWorld {
.js_request_data
.call1(
&JsValue::NULL,
&format!("@{}/{}-{}", spec.namespace, spec.name, spec.version).into(),
&format!("@{}/{}/{}", spec.namespace, spec.name, spec.version).into(),
)
.map_err(f)?
.as_string()

View File

@ -185,12 +185,12 @@ export default class TypstPlugin extends Plugin {
spec = spec.slice(1)
let subdir = "/typst/packages/" + spec
let dir = normalizePath(this.getDataDir() + subdir)
let dir = require('path').normalize(this.getDataDir() + subdir)
if (this.fs.existsSync(dir)) {
return dir
}
dir = normalizePath(this.getCacheDir() + subdir)
dir = require('path').normalize(this.getCacheDir() + subdir)
if (this.fs.existsSync(dir)) {
return dir