From faee30b5d28cfa1bf91f34498977a0774e60ca94 Mon Sep 17 00:00:00 2001 From: Theo Fabi <92238946+theofabilous@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:43:24 -0400 Subject: [PATCH] Fix: wrong paths generated for `@local`/`@preview` packages (#30) --- compiler/src/lib.rs | 2 +- src/main.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 63f5b06..c9f5b51 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -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() diff --git a/src/main.ts b/src/main.ts index a757905..52b219b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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