Skip to content

Commit

Permalink
fix: create-vuestic crossplatform paths (#4379)
Browse files Browse the repository at this point in the history
  • Loading branch information
shpingalet007 authored Sep 23, 2024
1 parent 5b53670 commit cdf8654
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/create-vuestic/src/steps/1.scaffoldProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
3 changes: 2 additions & 1 deletion packages/create-vuestic/src/steps/3.initGit.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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()

if (!runGitInit) { return }

return execp('git init', {
cwd: `${process.cwd()}/${projectName}`,
cwd: resolvePath(process.cwd(), projectName)!,
})
}
3 changes: 2 additions & 1 deletion packages/create-vuestic/src/steps/4.installDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit cdf8654

Please sign in to comment.