Skip to content

Commit

Permalink
update bin execution for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
fcannizzaro committed Dec 26, 2023
1 parent 78cf98e commit d60b3da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
},
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <fcannizzaro>",
"license": "MIT",
Expand Down

0 comments on commit d60b3da

Please sign in to comment.