Skip to content

Commit

Permalink
support for bunx
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Aug 24, 2023
1 parent 61aeda8 commit 48f1be9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ prompt.run().then(language => {
if (err) return console.error('Copy failed: ' + err);
console.info(`✂️ Created ${results.length} files.`);

const pkgManager = /yarn/.test(process.env.npm_execpath) ? 'yarn' : 'npm';
const pkgManagerCmd = /^win/.test(process.platform) ? `${pkgManager}.cmd` : pkgManager;

console.log(`📦 Installing dependencies... (${pkgManager})`);
const pkgManager = (typeof(Bun) !== "undefined" || (process.env.npm_config_user_agent && process.env.npm_config_user_agent.indexOf("bun") >= 0))
? 'bun'
: (/yarn/.test(process.env.npm_execpath))
? 'yarn'
: 'npm';
const pkgManagerCmd = (/^win/.test(process.platform) && pkgManager !== "bun") ? `${pkgManager}.cmd` : pkgManager;

console.log(`📦 Installing dependencies... (${pkgManager} install)`);

// npm install with --prefix causes issues on Windows. need to enter the directory first.
process.chdir(outputDir);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-colyseus-app",
"version": "0.15.11",
"version": "0.15.14",
"description": "npm init template for bootstrapping an empty Colyseus project",
"main": "lib/index.js",
"bin": {
Expand Down

0 comments on commit 48f1be9

Please sign in to comment.