From d60b3dacff6a08d86b8ab260559753fd8b045a9d Mon Sep 17 00:00:00 2001 From: Francesco Saverio Cannizzaro Date: Tue, 26 Dec 2023 11:19:07 +0100 Subject: [PATCH] update bin execution for macos --- index.js | 16 ++++++++++------ package.json | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 5c4a587..5809572 100644 --- a/index.js +++ b/index.js @@ -16,17 +16,19 @@ export default function (options) { throw new Error("Missing plugin param"); } return { - name: "elgato-distribution-tool", + name: "stream-deck-package", buildEnd() { + const platform = os.platform(); + const bin = - os.platform() === "win32" + platform === "win32" ? "DistributionTool.exe" - : os.platform() === "darwin" + : platform === "darwin" ? "DistributionTool" : undefined; if (!bin) { - return this.error(`Unsupported platform ${os.platform()}`); + return this.error(`Unsupported platform ${platform}`); } const pluginPath = path.join(process.cwd(), options.plugin); @@ -53,12 +55,14 @@ export default function (options) { } try { + platform === "darwin" && execSync(`chmod +x ${__dirname}/bin/${bin}`); + execSync( `${__dirname}/bin/${bin} -b -i ${pluginPath} -o ${outputPath}` ); } catch (e) { - console.log(e); - return this.error(`Plugin build failed`); + this.error(`Plugin build failed`); + this.error(e); } }, }; diff --git a/package.json b/package.json index 1e79deb..587e04d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fcannizzaro/rollup-stream-deck-package", - "version": "1.0.1", + "version": "1.0.2", "description": "Rollup plugin to create a distribution package for Elgato Stream Deck plguins", "author": "Francesco Saverio Cannizzaro ", "license": "MIT",