Skip to content

Commit d60b3da

Browse files
committed
update bin execution for macos
1 parent 78cf98e commit d60b3da

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ export default function (options) {
1616
throw new Error("Missing plugin param");
1717
}
1818
return {
19-
name: "elgato-distribution-tool",
19+
name: "stream-deck-package",
2020
buildEnd() {
21+
const platform = os.platform();
22+
2123
const bin =
22-
os.platform() === "win32"
24+
platform === "win32"
2325
? "DistributionTool.exe"
24-
: os.platform() === "darwin"
26+
: platform === "darwin"
2527
? "DistributionTool"
2628
: undefined;
2729

2830
if (!bin) {
29-
return this.error(`Unsupported platform ${os.platform()}`);
31+
return this.error(`Unsupported platform ${platform}`);
3032
}
3133

3234
const pluginPath = path.join(process.cwd(), options.plugin);
@@ -53,12 +55,14 @@ export default function (options) {
5355
}
5456

5557
try {
58+
platform === "darwin" && execSync(`chmod +x ${__dirname}/bin/${bin}`);
59+
5660
execSync(
5761
`${__dirname}/bin/${bin} -b -i ${pluginPath} -o ${outputPath}`
5862
);
5963
} catch (e) {
60-
console.log(e);
61-
return this.error(`Plugin build failed`);
64+
this.error(`Plugin build failed`);
65+
this.error(e);
6266
}
6367
},
6468
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fcannizzaro/rollup-stream-deck-package",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Rollup plugin to create a distribution package for Elgato Stream Deck plguins",
55
"author": "Francesco Saverio Cannizzaro <fcannizzaro>",
66
"license": "MIT",

0 commit comments

Comments
 (0)