File tree Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,27 @@ if (!fs.existsSync(binaryPath)) {
32
32
process . exit ( 1 ) ;
33
33
}
34
34
35
+ // Check executable permissions on Unix-like systems
36
+ if ( platform !== 'win32' ) {
37
+ try {
38
+ const stat = fs . statSync ( binaryPath ) ;
39
+ // Check if file is executable for user
40
+ if ( ( stat . mode & 0o100 ) === 0 ) {
41
+ try {
42
+ fs . chmodSync ( binaryPath , 0o755 ) ;
43
+ } catch ( error ) {
44
+ console . error ( '\nError: Binary is not executable and could not set permissions automatically.' ) ;
45
+ console . error ( `Please run: sudo chmod +x "${ binaryPath } "\n` ) ;
46
+ process . exit ( 1 ) ;
47
+ }
48
+ }
49
+ } catch ( error ) {
50
+ console . error ( '\nError: Could not check binary permissions.' ) ;
51
+ console . error ( `Please run: sudo chmod +x "${ binaryPath } "\n` ) ;
52
+ process . exit ( 1 ) ;
53
+ }
54
+ }
55
+
35
56
// Execute the binary with the same arguments
36
57
const result = spawnSync ( binaryPath , process . argv . slice ( 2 ) , {
37
58
stdio : 'inherit'
Original file line number Diff line number Diff line change 3
3
"version" : " 1.0.0" ,
4
4
"description" : " CLI tool for managing GitHub bounties" ,
5
5
"bin" : {
6
- "bounty" : " ./bin/bounty.js" ,
7
- "@bountybot/cli" : " ./bin/bounty.js"
6
+ "bounty" : " ./bin/bounty.js"
8
7
},
9
8
"scripts" : {
10
9
"prepare" : " node scripts/build.js" ,
11
10
"build" : " node scripts/build.js" ,
12
- "build:release" : " node scripts/build.js --release"
13
- },
11
+ "build:release" : " node scripts/build.js --release" ,
12
+ "postinstall" : " node scripts/postinstall.js"
13
+ },
14
14
"files" : [
15
15
" bin" ,
16
16
" scripts"
23
23
"devDependencies" : {
24
24
"fs-extra" : " ^11.2.0"
25
25
},
26
+ "dependencies" : {
27
+ "fs-extra" : " ^11.2.0"
28
+ },
26
29
"publishConfig" : {
27
- "access" : " public" ,
28
- "preserveSymlinks" : true
30
+ "access" : " public"
29
31
}
30
32
}
You can’t perform that action at this time.
0 commit comments