@moonrepo/cli 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/moon +0 -0
  2. package/package.json +11 -6
  3. package/postinstall.js +13 -17
package/moon CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonrepo/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "moon command line and core system.",
5
5
  "keywords": [
6
6
  "moon",
@@ -14,8 +14,13 @@
14
14
  "darwin"
15
15
  ],
16
16
  "cpu": [
17
+ "arm64",
17
18
  "x64"
18
19
  ],
20
+ "libc": [
21
+ "glibc",
22
+ "musl"
23
+ ],
19
24
  "files": [
20
25
  "moon",
21
26
  "postinstall.js"
@@ -37,10 +42,10 @@
37
42
  "detect-libc": "^2.0.1"
38
43
  },
39
44
  "optionalDependencies": {
40
- "@moonrepo/core-linux-x64-gnu": "^0.2.0",
41
- "@moonrepo/core-linux-x64-musl": "^0.2.0",
42
- "@moonrepo/core-macos-arm64": "^0.2.0",
43
- "@moonrepo/core-macos-x64": "^0.2.0",
44
- "@moonrepo/core-windows-x64-msvc": "^0.2.0"
45
+ "@moonrepo/core-linux-x64-gnu": "^0.2.1",
46
+ "@moonrepo/core-linux-x64-musl": "^0.2.1",
47
+ "@moonrepo/core-macos-arm64": "^0.2.1",
48
+ "@moonrepo/core-macos-x64": "^0.2.1",
49
+ "@moonrepo/core-windows-x64-msvc": "^0.2.1"
45
50
  }
46
51
  }
package/postinstall.js CHANGED
@@ -28,25 +28,21 @@ if (process.platform === 'linux') {
28
28
 
29
29
  const binary = process.platform === 'win32' ? 'moon.exe' : 'moon';
30
30
  const triple = parts.join('-');
31
- let pkgPath;
32
31
 
33
- try {
34
- pkgPath = path.dirname(require.resolve(`@moonrepo/core-${triple}/package.json`));
35
-
36
- if (!fs.existsSync(path.join(pkgPath, binary))) {
37
- throw new Error('Target not built.');
38
- }
39
- } catch {
40
- pkgPath = path.join(__dirname, '../../target/release');
41
- }
32
+ const pkgPath = path.dirname(require.resolve(`@moonrepo/core-${triple}/package.json`));
33
+ const binPath = path.join(pkgPath, binary);
42
34
 
43
35
  try {
44
- fs.linkSync(path.join(pkgPath, binary), path.join(__dirname, binary));
45
- } catch {
46
- try {
47
- fs.copyFileSync(path.join(pkgPath, binary), path.join(__dirname, binary));
48
- } catch {
49
- console.error('Failed to find "moon" binary.');
50
- // process.exit(1);
36
+ if (fs.existsSync(binPath)) {
37
+ try {
38
+ fs.linkSync(binPath, path.join(__dirname, binary));
39
+ } catch {
40
+ fs.copyFileSync(binPath, path.join(__dirname, binary));
41
+ }
42
+ } else {
43
+ throw new Error();
51
44
  }
45
+ } catch {
46
+ console.error('Failed to find "moon" binary.');
47
+ // process.exit(1);
52
48
  }