Skip to content

Commit

Permalink
fix script permissions for npmjs.com
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneparrott committed Apr 8, 2021
1 parent c665818 commit ffb7f08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "rclnodejs-cli",
"version": "0.1.0",
"version": "0.1.1",
"description": "Commandline tools for the ROS2 rclnodejs client library",
"main": "index.js",
"bin": "./index.js",
"directories": {
"test": "test"
},
"scripts": {
"postinstall": "colcon build --base-paths package-creation-tool",
"postinstall": "colcon build --base-paths package-creation-tool && node scripts/set_script_permissions.js",
"test": "mocha",
"lint": "eslint --max-warnings=0 --ext js index.js src message-generator-tool package-creation-tool test"
},
Expand Down
18 changes: 18 additions & 0 deletions scripts/set_script_permissions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env node

const fs = require('fs');
const path = require('path');

function updateScriptPermissions() {
if (process.platform == 'win32') return;

let folder = path.join(__dirname, '..', 'package-creation-tool', 'scripts');
let fd = fs.openSync(folder, 'r');
fs.fchmodSync(fd, 0o775);

let script = path.join(folder, 'create_ros_nodejs_pkg.sh');
fd = fs.openSync(script, 'r');
fs.fchmodSync(fd, 0o775);
}

updateScriptPermissions();

0 comments on commit ffb7f08

Please sign in to comment.