Skip to content

Commit cdf8654

Browse files
fix: create-vuestic crossplatform paths (#4379)
1 parent 5b53670 commit cdf8654

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/create-vuestic/src/steps/1.scaffoldProject.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import { UserAnswers } from './../prompts';
33
import { createVue } from "../generators/create-vue"
44
import { createNuxt3 } from "../generators/create-nuxt"
55
import { createVuesticAdmin } from '../generators/create-vuestic-admin';
6+
import { resolvePath } from "../utils/resolve-path"
67

78
export const scaffoldProject = async (options: UserAnswers) => {
89
const { projectName, projectType, projectFeatures = [] } = options
910

10-
const path = [process.cwd(), projectName].join('/')
11+
const path = resolvePath(process.cwd(), projectName)!
1112

1213
try {
1314
if (projectType === 'create-vue') {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { useUserAnswers } from '../composables/useUserAnswers';
22
import { execp } from './../utils/exacp';
3+
import { resolvePath } from "../utils/resolve-path"
34

45
export const initGit = async () => {
56
const { runGitInit, projectName } = await useUserAnswers()
67

78
if (!runGitInit) { return }
89

910
return execp('git init', {
10-
cwd: `${process.cwd()}/${projectName}`,
11+
cwd: resolvePath(process.cwd(), projectName)!,
1112
})
1213
}

packages/create-vuestic/src/steps/4.installDeps.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useUserAnswers } from '../composables/useUserAnswers';
22
import { getPackageManagerName } from '../utils/package-manager';
33
import { execp } from '../utils/exacp';
44
import { withSpinner } from '../utils/with-spinner';
5+
import { resolvePath } from "../utils/resolve-path"
56

67
export const installDeps = async () => {
78
const { runInstall, projectName } = await useUserAnswers()
@@ -12,7 +13,7 @@ export const installDeps = async () => {
1213

1314
return await withSpinner('Installing dependencies...', async () => {
1415
await execp(`${packageManager} install`, {
15-
cwd: `${process.cwd()}/${projectName}`,
16+
cwd: resolvePath(process.cwd(), projectName)!,
1617
})
1718
})
1819
return

0 commit comments

Comments
 (0)