-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { exec } = require("node:child_process") | ||
const path = require("node:path") | ||
|
||
// Function to execute shell commands | ||
function executeCommand(command, callback) { | ||
exec(command, (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`) | ||
callback(false, stderr) | ||
return | ||
} | ||
console.log(stdout) | ||
callback(true, stdout) | ||
}) | ||
} | ||
|
||
// Step 1: Install Bun | ||
const installBunCommand = "curl -fsSL https://bun.sh/install | bash" | ||
console.log("Installing Bun...") | ||
executeCommand(installBunCommand, (success, result) => { | ||
if (!success) { | ||
console.error("Failed to install Bun:", result) | ||
process.exit(1) // Exit the process with a non-zero exit code | ||
} | ||
console.log("Bun installation completed.") | ||
|
||
// Step 2: Run ~/.bun/bin/bun run start | ||
// Assuming the default installation path | ||
const runBunCommand = "~/.bun/bin/bun run start" | ||
console.log("Running ~/.bun/bin/bun run start...") | ||
executeCommand(runBunCommand, (success, result) => { | ||
if (!success) { | ||
console.error("Failed to run the command with Bun:", result) | ||
process.exit(1) // Exit the process with a non-zero exit code | ||
} | ||
console.log("Successfully ran the command with Bun:", result) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters