@package-pal/cli 0.0.31 → 0.0.33

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@package-pal/cli",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "CLI tool exposing core PackagePal functionality.",
5
5
  "keywords": [
6
6
  "package",
@@ -25,13 +25,13 @@
25
25
  "yoctocolors": "^2.1.1"
26
26
  },
27
27
  "optionalDependencies": {
28
- "@package-pal/cli-linux-x64": "0.0.6",
29
- "@package-pal/cli-linux-x64-musl": "0.0.6",
30
- "@package-pal/cli-linux-arm64": "0.0.6",
31
- "@package-pal/cli-linux-arm64-musl": "0.0.6",
32
- "@package-pal/cli-darwin-arm64": "0.0.6",
33
- "@package-pal/cli-darwin-x64": "0.0.6",
34
- "@package-pal/cli-windows-x64": "0.0.6"
28
+ "@package-pal/cli-linux-x64": "0.0.8",
29
+ "@package-pal/cli-linux-x64-musl": "0.0.8",
30
+ "@package-pal/cli-linux-arm64": "0.0.8",
31
+ "@package-pal/cli-linux-arm64-musl": "0.0.8",
32
+ "@package-pal/cli-darwin-arm64": "0.0.8",
33
+ "@package-pal/cli-darwin-x64": "0.0.8",
34
+ "@package-pal/cli-windows-x64": "0.0.8"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=18"
@@ -1,4 +1,4 @@
1
- import { chmod } from 'fs/promises';
1
+ import { chmodSync } from 'fs';
2
2
  import { get } from 'https';
3
3
  import { join } from 'path';
4
4
  import { pipeline } from 'stream/promises';
@@ -77,7 +77,7 @@ const downloadAndExtract = async (
77
77
  }
78
78
 
79
79
  try {
80
- await chmod(join(outputBinDir, binExecutableName), 0o755);
80
+ chmodSync(join(outputBinDir, binExecutableName), 0o755);
81
81
  } catch {
82
82
  //
83
83
  }
@@ -1,44 +1,46 @@
1
- import {
2
- mkdirSync, rmSync,
3
- } from 'fs';
4
- import { linkExistingBinary } from './link-existing-binary.js';
5
- import { loadMissingBinary } from './load-missing-binary.js';
6
- import { validateBinaryVersion } from './validate-binary-version.js';
7
-
8
- /**
9
- * @param {{ platform: Bun.Platform, binExecutableName: string, targetPackage: string, targetVersion: string, targetBinPath: string | null, outputBinDir: string, outputBinBasePath: string, outputBinPath: string }} options
10
- */
11
- export const prepareBinary = ({
12
- platform, binExecutableName, targetPackage, targetVersion, targetBinPath, outputBinDir, outputBinBasePath, outputBinPath,
13
- }) => {
14
- if (targetBinPath) {
15
- console.info(`Expected CLI binary package is available in '${targetBinPath}'.`);
16
- validateBinaryVersion(targetVersion, targetBinPath);
17
- } else {
18
- console.warn(`Expected CLI binary was not found for '${targetPackage}'.`);
19
- }
20
-
21
- // Windows can't be optimised to run the binary directly (.exe).
22
- if (platform === 'win32') {
23
- return;
24
- }
25
-
26
- rmSync(outputBinBasePath, { force: true });
27
- rmSync(outputBinPath, { force: true });
28
- mkdirSync(outputBinDir, { recursive: true });
29
-
30
- if (targetBinPath) {
31
- linkExistingBinary({
32
- platform,
33
- targetBinPath,
34
- outputBinPath,
35
- });
36
- return;
37
- }
38
-
39
- return loadMissingBinary({
40
- binExecutableName,
41
- targetPackage,
42
- outputBinDir,
43
- });
44
- };
1
+ import {
2
+ chmodSync,
3
+ mkdirSync, rmSync,
4
+ } from 'fs';
5
+ import { linkExistingBinary } from './link-existing-binary.js';
6
+ import { loadMissingBinary } from './load-missing-binary.js';
7
+ import { validateBinaryVersion } from './validate-binary-version.js';
8
+
9
+ /**
10
+ * @param {{ platform: Bun.Platform, binExecutableName: string, targetPackage: string, targetVersion: string, targetBinPath: string | null, outputBinDir: string, outputBinBasePath: string, outputBinPath: string }} options
11
+ */
12
+ export const prepareBinary = ({
13
+ platform, binExecutableName, targetPackage, targetVersion, targetBinPath, outputBinDir, outputBinBasePath, outputBinPath,
14
+ }) => {
15
+ if (targetBinPath) {
16
+ console.info(`Expected CLI binary package is available in '${targetBinPath}'.`);
17
+ chmodSync(targetBinPath, 0o755);
18
+ validateBinaryVersion(targetVersion, targetBinPath);
19
+ } else {
20
+ console.warn(`Expected CLI binary was not found for '${targetPackage}'.`);
21
+ }
22
+
23
+ // Windows can't be optimised to run the binary directly (.exe).
24
+ if (platform === 'win32') {
25
+ return;
26
+ }
27
+
28
+ rmSync(outputBinBasePath, { force: true });
29
+ rmSync(outputBinPath, { force: true });
30
+ mkdirSync(outputBinDir, { recursive: true });
31
+
32
+ if (targetBinPath) {
33
+ linkExistingBinary({
34
+ platform,
35
+ targetBinPath,
36
+ outputBinPath,
37
+ });
38
+ return;
39
+ }
40
+
41
+ return loadMissingBinary({
42
+ binExecutableName,
43
+ targetPackage,
44
+ outputBinDir,
45
+ });
46
+ };