Skip to content

Commit 339f93c

Browse files
committed
fix: add missed postinstall script
1 parent eda50db commit 339f93c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

bin/todoctor.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import os from 'node:os'
77
import fs from 'node:fs'
88

99
let filename = fileURLToPath(import.meta.url)
10+
let dirname = path.dirname(filename)
1011

1112
let platform = os.platform()
1213
let arch = os.arch()
1314

14-
export let dirname = path.dirname(filename)
15-
1615
export let binaries = {
1716
'win32:x64': 'windows/x64/todoctor.exe',
1817
'darwin:arm64': 'macos/arm64/todoctor',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"files": [
5858
"./bin",
5959
"./build",
60-
"./dist"
60+
"./dist",
61+
"./scripts"
6162
],
6263
"devDependencies": {
6364
"@azat-io/eslint-config-typescript": "^1.10.0",

scripts/postinstall.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import { fileURLToPath } from 'node:url'
12
import path from 'node:path'
23
import fs from 'node:fs'
34

4-
import { dirname as binDirectory, binaries } from '../bin/todoctor'
5+
import { binaries } from '../bin/todoctor'
6+
7+
let filename = fileURLToPath(import.meta.url)
8+
let dirname = path.dirname(filename)
59

610
Object.values(binaries).forEach(binaryPath => {
7-
fs.chmodSync(path.join(binDirectory, binaryPath), 0o755)
11+
fs.chmodSync(path.join(dirname, '../bin/', binaryPath), 0o755)
812
})

0 commit comments

Comments
 (0)