From cdf86545d5ec1340fe9c10c50d93b235132ffae0 Mon Sep 17 00:00:00 2001 From: Pavel Vernigorov <22795961+shpingalet007@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:40:25 +0200 Subject: [PATCH] fix: create-vuestic crossplatform paths (#4379) --- packages/create-vuestic/src/steps/1.scaffoldProject.ts | 3 ++- packages/create-vuestic/src/steps/3.initGit.ts | 3 ++- packages/create-vuestic/src/steps/4.installDeps.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/create-vuestic/src/steps/1.scaffoldProject.ts b/packages/create-vuestic/src/steps/1.scaffoldProject.ts index 19715a06c5..361be8c6f6 100644 --- a/packages/create-vuestic/src/steps/1.scaffoldProject.ts +++ b/packages/create-vuestic/src/steps/1.scaffoldProject.ts @@ -3,11 +3,12 @@ import { UserAnswers } from './../prompts'; import { createVue } from "../generators/create-vue" import { createNuxt3 } from "../generators/create-nuxt" import { createVuesticAdmin } from '../generators/create-vuestic-admin'; +import { resolvePath } from "../utils/resolve-path" export const scaffoldProject = async (options: UserAnswers) => { const { projectName, projectType, projectFeatures = [] } = options - const path = [process.cwd(), projectName].join('/') + const path = resolvePath(process.cwd(), projectName)! try { if (projectType === 'create-vue') { diff --git a/packages/create-vuestic/src/steps/3.initGit.ts b/packages/create-vuestic/src/steps/3.initGit.ts index b6098ab077..2bf8cb0572 100644 --- a/packages/create-vuestic/src/steps/3.initGit.ts +++ b/packages/create-vuestic/src/steps/3.initGit.ts @@ -1,5 +1,6 @@ import { useUserAnswers } from '../composables/useUserAnswers'; import { execp } from './../utils/exacp'; +import { resolvePath } from "../utils/resolve-path" export const initGit = async () => { const { runGitInit, projectName } = await useUserAnswers() @@ -7,6 +8,6 @@ export const initGit = async () => { if (!runGitInit) { return } return execp('git init', { - cwd: `${process.cwd()}/${projectName}`, + cwd: resolvePath(process.cwd(), projectName)!, }) } diff --git a/packages/create-vuestic/src/steps/4.installDeps.ts b/packages/create-vuestic/src/steps/4.installDeps.ts index 03b804d100..8e7a9ee4ed 100644 --- a/packages/create-vuestic/src/steps/4.installDeps.ts +++ b/packages/create-vuestic/src/steps/4.installDeps.ts @@ -2,6 +2,7 @@ import { useUserAnswers } from '../composables/useUserAnswers'; import { getPackageManagerName } from '../utils/package-manager'; import { execp } from '../utils/exacp'; import { withSpinner } from '../utils/with-spinner'; +import { resolvePath } from "../utils/resolve-path" export const installDeps = async () => { const { runInstall, projectName } = await useUserAnswers() @@ -12,7 +13,7 @@ export const installDeps = async () => { return await withSpinner('Installing dependencies...', async () => { await execp(`${packageManager} install`, { - cwd: `${process.cwd()}/${projectName}`, + cwd: resolvePath(process.cwd(), projectName)!, }) }) return