create-gamenative-app 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/create.js +6 -9
  2. package/package.json +1 -1
package/bin/create.js CHANGED
@@ -3,7 +3,7 @@ import inquirer from 'inquirer'
3
3
  import { mkdir, writeFile, copyFile, readFile } from 'fs/promises'
4
4
  import { join, dirname } from 'path'
5
5
  import { fileURLToPath } from 'url'
6
- import { spawn } from 'child_process'
6
+ import { execSync } from 'child_process'
7
7
 
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url))
9
9
  const FRAMEWORK_ROOT = join(__dirname, '..')
@@ -343,14 +343,11 @@ All of this is done in your \`Game.ts\` using \`ctx.gl\`, \`ctx.input\`, and the
343
343
  }
344
344
 
345
345
  function npmInstall(cwd) {
346
- return new Promise((resolve, reject) => {
347
- const isWin = process.platform === 'win32'
348
- const child = spawn(isWin ? 'npm.cmd' : 'npm', ['install'], {
349
- cwd,
350
- stdio: 'inherit',
351
- })
352
- child.on('close', (code) => (code === 0 ? resolve() : reject(new Error('npm install failed'))))
353
- })
346
+ try {
347
+ execSync('npm install', { cwd, stdio: 'inherit' })
348
+ } catch {
349
+ throw new Error('npm install failed')
350
+ }
354
351
  }
355
352
 
356
353
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gamenative-app",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Native TypeScript framework for desktop games — no game engine, just SDL + WebGL.",
5
5
  "type": "module",
6
6
  "main": "dist/scripts/main.js",