Skip to content

Commit

Permalink
fix: use correct cwd when syncing SvelteKit projects (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 authored Jul 21, 2024
1 parent 79749bd commit d43d140
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-dancers-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn-svelte": patch
---

fix: Use correct cwd when syncing SvelteKit projects
3 changes: 2 additions & 1 deletion packages/cli/src/utils/sveltekit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "node:fs";
import path from "node:path";
import { execa } from "execa";
import { getPackageManager } from "./get-package-manager.js";
import { loadProjectPackageInfo } from "./get-package-info.js";
Expand All @@ -8,7 +9,7 @@ export async function syncSvelteKit(cwd: string) {
const isSvelteKit = isUsingSvelteKit(cwd);
if (isSvelteKit) {
// we'll exit early since syncing is rather slow
if (fs.existsSync(".svelte-kit")) return;
if (fs.existsSync(path.join(cwd, ".svelte-kit"))) return;

const packageManager = await getPackageManager(cwd);
await execa(packageManager === "npm" ? "npx" : packageManager, ["svelte-kit", "sync"], {
Expand Down

0 comments on commit d43d140

Please sign in to comment.