arashi 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/postinstall.js +9 -9
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* This keeps the npm package size small while providing pre-compiled binaries
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { join, dirname } from "node:path";
|
|
8
|
+
import { access, constants, mkdir } from "node:fs/promises";
|
|
9
|
+
import { chmodSync, createWriteStream } from "node:fs";
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
12
11
|
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { get } from "node:https";
|
|
13
13
|
|
|
14
14
|
const __filename = fileURLToPath(import.meta.url);
|
|
15
15
|
const __dirname = dirname(__filename);
|
|
@@ -19,10 +19,10 @@ const GITHUB_REPO = "corwinm/arashi";
|
|
|
19
19
|
|
|
20
20
|
// Determine platform and binary name
|
|
21
21
|
function getPlatformInfo() {
|
|
22
|
-
const platform = process
|
|
23
|
-
const arch = process
|
|
22
|
+
const { platform } = process;
|
|
23
|
+
const { arch } = process;
|
|
24
24
|
|
|
25
|
-
let binaryName;
|
|
25
|
+
let binaryName = "";
|
|
26
26
|
if (platform === "darwin" && arch === "arm64") {
|
|
27
27
|
binaryName = `${PACKAGE_NAME}-macos-arm64`;
|
|
28
28
|
} else if (platform === "linux" && arch === "x64") {
|
|
@@ -99,7 +99,7 @@ async function install() {
|
|
|
99
99
|
// Get version from package.json
|
|
100
100
|
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
101
101
|
const { readFile } = await import("node:fs/promises");
|
|
102
|
-
const packageJson = JSON.parse(await readFile(packageJsonPath, "
|
|
102
|
+
const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
|
|
103
103
|
const { version } = packageJson;
|
|
104
104
|
|
|
105
105
|
const { binaryName, isWindows } = getPlatformInfo();
|
|
@@ -139,4 +139,4 @@ async function install() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
install();
|
|
142
|
+
await install();
|