mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 10:39:57 +00:00
Fix basename in bridge usage info
This commit is contained in:
@@ -159,7 +159,7 @@ async function build () {
|
|||||||
`@echo off
|
`@echo off
|
||||||
setlocal
|
setlocal
|
||||||
set NODE_PATH=${modulesDir}
|
set NODE_PATH=${modulesDir}
|
||||||
node %~dp0src\\main.js %*
|
node %~dp0src\\main.js --__name %~n0%~x0 %*
|
||||||
endlocal
|
endlocal
|
||||||
`);
|
`);
|
||||||
break;
|
break;
|
||||||
@@ -170,7 +170,7 @@ endlocal
|
|||||||
launcherPath += ".sh";
|
launcherPath += ".sh";
|
||||||
fs.writeFileSync(launcherPath,
|
fs.writeFileSync(launcherPath,
|
||||||
`#!/usr/bin/env sh
|
`#!/usr/bin/env sh
|
||||||
NODE_PATH="${modulesDir}" node $(dirname $0)/src/main.js "$@"
|
NODE_PATH="${modulesDir}" node $(dirname $0)/src/main.js --__name $(basename $0) "$@"
|
||||||
`);
|
`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import minimist from "minimist";
|
|||||||
|
|
||||||
const argv = minimist(process.argv.slice(2), {
|
const argv = minimist(process.argv.slice(2), {
|
||||||
boolean: [ "daemon", "help", "version" ]
|
boolean: [ "daemon", "help", "version" ]
|
||||||
, string: [ "port" ]
|
, string: [ "__name", "port" ]
|
||||||
, alias: {
|
, alias: {
|
||||||
d: "daemon"
|
d: "daemon"
|
||||||
, h: "help"
|
, h: "help"
|
||||||
@@ -14,7 +14,8 @@ const argv = minimist(process.argv.slice(2), {
|
|||||||
, p: "port"
|
, p: "port"
|
||||||
}
|
}
|
||||||
, default: {
|
, default: {
|
||||||
daemon: false
|
__name: path.basename(process.argv[0])
|
||||||
|
, daemon: false
|
||||||
, port: "9556"
|
, port: "9556"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -25,7 +26,7 @@ if (argv.version) {
|
|||||||
console.log(`v0.0.7`);
|
console.log(`v0.0.7`);
|
||||||
} else if (argv.help) {
|
} else if (argv.help) {
|
||||||
console.log(
|
console.log(
|
||||||
`Usage: ${path.basename(process.argv[0])} [options]
|
`Usage: ${argv.__name} [options]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help Print usage info
|
-h, --help Print usage info
|
||||||
|
|||||||
Reference in New Issue
Block a user