Skip to content

Commit ca65e23

Browse files
committed
fix: chmod on load in Nodejs
Npm doesn't seem to preserve the permissions
1 parent ece171c commit ca65e23

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aminya/minijson",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Minify JSON files blazing fast! Supports Comments. Uses D, C, and AVX2 and SSE4_1 SIMD",
55
"homepage": "https://github.com/aminya/minijson",
66
"license": "MIT",

src/node/lib.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { execFile } from "child_process"
2+
import { chmodSync } from "fs"
23
import { readFile, writeFile } from "fs/promises"
34
import { join } from "path"
45

@@ -64,6 +65,11 @@ const binName = `minijson${exeExtention}`
6465

6566
const minijsonBin = join(__dirname, `${process.platform}-${process.arch}`, binName)
6667

68+
// chmod as executable on non-windows
69+
if (process.platform !== "win32") {
70+
chmodSync(minijsonBin, 0o755)
71+
}
72+
6773
/**
6874
* Spawn minijson with the given arguments
6975
*

0 commit comments

Comments
 (0)