@lapius/bin-cli 0.2.1 → 0.2.3

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/README.md +1 -1
  2. package/bin/bin +3 -1
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  npm(Linux / macOS / Windows):
8
8
 
9
9
  ```bash
10
- npm i -g @lapius/bin-cli
10
+ pnpm add -g @lapius/bin-cli
11
11
  ```
12
12
 
13
13
  OS/CPUに合ったビルド済みバイナリが入る(Linux/macOSでは初回の起動時にnodeのシムがネイティブバイナリに置き換わり、以後はnodeを経由しない)。更新は同じコマンドで行う。
package/bin/bin CHANGED
@@ -13,13 +13,15 @@ try {
13
13
  bin = require.resolve(`${pkg}/bin/${exe}`);
14
14
  } catch {
15
15
  console.error(`bin: ${pkg} が見つかりません(未対応の環境か、optionalDependencies が省略されました)`);
16
- console.error(' npm i -g @lapius/bin-cli で入れ直してください');
16
+ console.error(' pnpm add -g @lapius/bin-cli で入れ直してください');
17
17
  process.exit(1);
18
18
  }
19
19
 
20
20
  // Windows は npm が node 経由の .cmd を作るので置き換えない
21
21
  if (process.platform !== 'win32') {
22
22
  try {
23
+ // npm は bin をシンボリックリンクで置くので置き換えてよい。pnpm は node で起動するシムを作るため、置き換えると壊れる
24
+ if (!fs.lstatSync(process.argv[1]).isSymbolicLink()) throw new Error('not a symlink');
23
25
  const self = fs.realpathSync(__filename);
24
26
  const tmp = `${self}.${process.pid}.tmp`;
25
27
  fs.copyFileSync(bin, tmp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lapius/bin-cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "bin.lapius7.com(LapBin)の CLI クライアント",
5
5
  "keywords": [
6
6
  "cli",
@@ -30,10 +30,10 @@
30
30
  "arm64"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "@lapius/bin-cli-linux-x64": "0.2.1",
34
- "@lapius/bin-cli-linux-arm64": "0.2.1",
35
- "@lapius/bin-cli-darwin-x64": "0.2.1",
36
- "@lapius/bin-cli-darwin-arm64": "0.2.1",
37
- "@lapius/bin-cli-win32-x64": "0.2.1"
33
+ "@lapius/bin-cli-linux-x64": "0.2.3",
34
+ "@lapius/bin-cli-linux-arm64": "0.2.3",
35
+ "@lapius/bin-cli-darwin-x64": "0.2.3",
36
+ "@lapius/bin-cli-darwin-arm64": "0.2.3",
37
+ "@lapius/bin-cli-win32-x64": "0.2.3"
38
38
  }
39
39
  }