-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
39 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
#!/usr/bin/env node | ||
#!/bin/sh | ||
|
||
require('../lib/binaries/CLI.js'); | ||
SCRIPT_PATH="$(dirname "$0")/../lib/binaries/CLI.js" | ||
|
||
# Check if 'bun' is available, otherwise use 'node' | ||
if command -v bun >/dev/null 2>&1 | ||
then | ||
bun "$SCRIPT_PATH" "$@" | ||
else | ||
node "$SCRIPT_PATH" "$@" | ||
fi |
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,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('../lib/binaries/CLI.js'); |
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,24 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// Determine platform | ||
const isWindows = process.platform === 'win32'; | ||
|
||
if (!isWindows) | ||
process.exit(0) | ||
|
||
const sourceFile = 'bin/pm2-windows'; | ||
const destinationFile = 'bin/pm2'; | ||
|
||
// Resolve file paths | ||
const sourcePath = path.resolve(__dirname, sourceFile); | ||
const destinationPath = path.resolve(__dirname, destinationFile); | ||
|
||
// Copy the appropriate file based on the platform | ||
fs.copyFile(sourcePath, destinationPath, (err) => { | ||
if (err) { | ||
console.error(`Error copying file from ${sourcePath} to ${destinationPath}:`, err); | ||
process.exit(1); | ||
} | ||
console.log(`Successfully copied ${sourceFile} to ${destinationFile}`); | ||
}); |