Skip to content

Commit

Permalink
v0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackRam-oss committed Oct 25, 2024
1 parent dd87573 commit 3189123
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
package-lock.json
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-pixi-vn",
"description": "Create a new Pixi’VN project",
"version": "0.2.4",
"version": "0.2.5",
"type": "module",
"license": "GPL-3.0",
"author": "DRincs-Productions",
Expand Down Expand Up @@ -40,6 +40,7 @@
"kolorist": "^1.8.0",
"minimist": "^1.2.8",
"prompts": "^2.4.2",
"unbuild": "^2.0.0"
"unbuild": "^2.0.0",
"which": "^5.0.0"
}
}
30 changes: 28 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function init() {
targetDir === '.' ? path.basename(path.resolve()) : targetDir

let result: prompts.Answers<
'projectName' | 'overwrite' | 'packageName' | 'framework' | 'variant'
'projectName' | 'overwrite' | 'packageName' | 'framework' | 'variant' | 'ide'
>

prompts.override({
Expand Down Expand Up @@ -189,6 +189,18 @@ async function init() {
}
}),
},
// which IDE do you want to use?
{
type: 'select',
name: 'ide',
message: 'Which IDE do you want to use?',
choices: [
{ title: 'Visual Studio Code', value: 'vscode' },
{ title: 'Cursor', value: 'cursor' },
{ title: 'Other', value: 'other' },
],
initial: 0,
}
],
{
onCancel: () => {
Expand All @@ -202,7 +214,7 @@ async function init() {
}

// user choice associated with prompts
const { framework, overwrite, packageName, variant } = result
const { framework, overwrite, packageName, variant, ide } = result

const root = path.join(cwd, targetDir)

Expand Down Expand Up @@ -309,6 +321,20 @@ async function init() {
console.log(` ${pkgManager} run start`)
break
}

let projectPath = path.resolve(root)

if (ide === undefined) {
return
}
try {
const resolved = await which(ide)
spawn(resolved, [projectPath], { detached: true })
} catch (error) {
console.error(
`Could not open project using ${ide}, since ${ide} was not in your PATH`,
)
}
console.log()
}

Expand Down

0 comments on commit 3189123

Please sign in to comment.