Skip to content

Commit

Permalink
fix: add missed postinstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Oct 22, 2024
1 parent eda50db commit 339f93c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions bin/todoctor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import os from 'node:os'
import fs from 'node:fs'

let filename = fileURLToPath(import.meta.url)
let dirname = path.dirname(filename)

let platform = os.platform()
let arch = os.arch()

export let dirname = path.dirname(filename)

export let binaries = {
'win32:x64': 'windows/x64/todoctor.exe',
'darwin:arm64': 'macos/arm64/todoctor',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"files": [
"./bin",
"./build",
"./dist"
"./dist",
"./scripts"
],
"devDependencies": {
"@azat-io/eslint-config-typescript": "^1.10.0",
Expand Down
8 changes: 6 additions & 2 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { fileURLToPath } from 'node:url'
import path from 'node:path'
import fs from 'node:fs'

import { dirname as binDirectory, binaries } from '../bin/todoctor'
import { binaries } from '../bin/todoctor'

let filename = fileURLToPath(import.meta.url)
let dirname = path.dirname(filename)

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

0 comments on commit 339f93c

Please sign in to comment.