mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 18:19:58 +00:00
Add usePkg option to restore previous build behavior
This commit is contained in:
@@ -32,7 +32,7 @@ const { executableName
|
|||||||
|
|
||||||
// Command line args
|
// Command line args
|
||||||
const argv = minimist(process.argv.slice(2), {
|
const argv = minimist(process.argv.slice(2), {
|
||||||
boolean: [ "package", "skipNativeBuilds" ]
|
boolean: [ "usePkg", "package", "skipNativeBuilds" ]
|
||||||
, string: [ "arch", "packageType" ]
|
, string: [ "arch", "packageType" ]
|
||||||
, default: {
|
, default: {
|
||||||
arch: os.arch()
|
arch: os.arch()
|
||||||
@@ -114,7 +114,7 @@ async function build () {
|
|||||||
* If packaging, add the installed executable path, otherwise
|
* If packaging, add the installed executable path, otherwise
|
||||||
* add the path to the built executable in the dist folder.
|
* add the path to the built executable in the dist folder.
|
||||||
*/
|
*/
|
||||||
if (argv.package) {
|
if (argv.package || argv.usePkg) {
|
||||||
// Need a minimal package.json for pkg.
|
// Need a minimal package.json for pkg.
|
||||||
const pkgManifest = {
|
const pkgManifest = {
|
||||||
bin: "main.js"
|
bin: "main.js"
|
||||||
@@ -143,10 +143,10 @@ async function build () {
|
|||||||
|
|
||||||
fs.removeSync(path.join(BUILD_PATH, "src"));
|
fs.removeSync(path.join(BUILD_PATH, "src"));
|
||||||
|
|
||||||
|
manifest.path = argv.usePkg
|
||||||
manifest.path = path.join(executablePath[process.platform]
|
? path.join(DIST_PATH, executableName[process.platform])
|
||||||
, executableName[process.platform]);
|
: path.join(executablePath[process.platform]
|
||||||
|
, executableName[process.platform]);
|
||||||
} else {
|
} else {
|
||||||
let launcherPath = path.join(BUILD_PATH
|
let launcherPath = path.join(BUILD_PATH
|
||||||
, meta.__applicationExecutableName);
|
, meta.__applicationExecutableName);
|
||||||
|
|||||||
Reference in New Issue
Block a user