Skip to content

Commit

Permalink
Refactor postinstall script for consistency and readability; update f…
Browse files Browse the repository at this point in the history
…ormatting in workflow and README
  • Loading branch information
binary-blazer committed Jan 19, 2025
1 parent f517e2e commit 34835a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.FORMAT_PAT }}
pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }}
pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ Contributions are welcome! Please read the [contributing guidelines](CONTRIBUTIN

## License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
24 changes: 12 additions & 12 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const { execSync } = require('node:child_process');
const os = require('node:os');
const { execSync } = require("node:child_process");
const os = require("node:os");

const platform = os.platform();
const distPath = 'dist/cli.js';
const distPath = "dist/cli.js";

console.log('Building the project...');
execSync('bun run build');
console.log('Build completed');
console.log("Building the project...");
execSync("bun run build");
console.log("Build completed");

if (platform === 'linux' || platform === 'darwin') {
if (platform === "linux" || platform === "darwin") {
execSync(`chmod +x ${distPath}`);
console.log('Set executable permissions for dist/cli.js');
} else if (platform === 'win32') {
console.log('Windows detected, no need to set executable permissions');
console.log("Set executable permissions for dist/cli.js");
} else if (platform === "win32") {
console.log("Windows detected, no need to set executable permissions");
} else {
console.log('Unknown platform, no changes made');
}
console.log("Unknown platform, no changes made");
}

0 comments on commit 34835a5

Please sign in to comment.