git-userhub 3.0.4 → 3.0.6

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/bin/git-user.js CHANGED
@@ -29,8 +29,20 @@ if (!osName || !archName) {
29
29
  process.exit(1);
30
30
  }
31
31
 
32
- const binaryName = `git-user-${osName}-${archName}${ext}`;
33
- const binaryPath = path.join(__dirname, binaryName);
32
+ const pkgPlatform = platform === 'win32' ? 'windows' : platform;
33
+ const pkgName = `git-userhub-${pkgPlatform}-${arch}`;
34
+
35
+ let binaryPath;
36
+ try {
37
+ // Find the sub-package directory by resolving its package.json
38
+ const subPkgPath = require.resolve(`${pkgName}/package.json`);
39
+ binaryPath = path.join(path.dirname(subPkgPath), 'bin', `git-user${ext}`);
40
+ } catch (e) {
41
+ console.error(`❌ git-user native binary not installed!`);
42
+ console.error(` npm should have installed the optional dependency '${pkgName}'.`);
43
+ console.error(` Please try reinstalling the package.`);
44
+ process.exit(1);
45
+ }
34
46
 
35
47
  if (!fs.existsSync(binaryPath)) {
36
48
  console.error(`❌ git-user binary not found at ${binaryPath}`);
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "git-userhub",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "Switch Git accounts in one command. No config editing. No SSH key chaos.",
5
5
  "bin": {
6
6
  "git-user": "bin/git-user.js"
7
7
  },
8
8
  "scripts": {
9
9
  "test": "echo \"No tests yet\" && exit 0",
10
- "prepublishOnly": "node scripts/download-binaries.js"
10
+ "release": "node scripts/release.js"
11
+ },
12
+ "optionalDependencies": {
13
+ "git-userhub-darwin-arm64": "3.0.6",
14
+ "git-userhub-darwin-x64": "3.0.6",
15
+ "git-userhub-linux-arm64": "3.0.6",
16
+ "git-userhub-linux-x64": "3.0.6",
17
+ "git-userhub-windows-x64": "3.0.6"
11
18
  },
12
19
  "devDependencies": {
13
20
  "tar": "^7.4.3"
@@ -0,0 +1,6 @@
1
+ 228e32fdccc3b553ddcefad445a75548c9df5ca03190879d7050008128449742 git-user_darwin_arm64.tar.gz
2
+ 5191fda6093bf66946a53504bb3ef0accf776d74d9b3467e36c9cd2c8d7df1a1 git-user_darwin_x86_64.tar.gz
3
+ e43a1171aeedc8f3bd92ddeb38e2b50fbabe5058c5874874c6295f8ea6ca716e git-user_linux_arm64.tar.gz
4
+ fd97690f902462b0f68ab930dd5e6c63ba33a1d5999851787091cf745fcbec60 git-user_linux_x86_64.tar.gz
5
+ 3b5ad0b0bfaeb0f2464b123d764cd5da9db2a3f496676e5d27c2ff8fc6957f75 git-user_windows_arm64.tar.gz
6
+ 2a15ecc32d0ae3d419f541477aff8687463cd3ab600807d96ed44ec50ecc7503 git-user_windows_x86_64.tar.gz
@@ -0,0 +1,4 @@
1
+ # git-userhub-darwin-arm64
2
+ This package contains the native binary for git-userhub on darwin arm64.
3
+
4
+ This is an internal package and shouldn't be installed directly. Install `git-userhub` instead.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "git-userhub-darwin-arm64",
3
+ "version": "3.0.6",
4
+ "description": "The darwin arm64 binary for git-userhub",
5
+ "os": [
6
+ "darwin"
7
+ ],
8
+ "cpu": [
9
+ "arm64"
10
+ ],
11
+ "bin": {
12
+ "git-user": "bin/git-user"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/divyo-argha/git-user.git"
17
+ },
18
+ "license": "MIT"
19
+ }
@@ -0,0 +1,4 @@
1
+ # git-userhub-darwin-x64
2
+ This package contains the native binary for git-userhub on darwin x64.
3
+
4
+ This is an internal package and shouldn't be installed directly. Install `git-userhub` instead.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "git-userhub-darwin-x64",
3
+ "version": "3.0.6",
4
+ "description": "The darwin x64 binary for git-userhub",
5
+ "os": [
6
+ "darwin"
7
+ ],
8
+ "cpu": [
9
+ "x64"
10
+ ],
11
+ "bin": {
12
+ "git-user": "bin/git-user"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/divyo-argha/git-user.git"
17
+ },
18
+ "license": "MIT"
19
+ }
@@ -0,0 +1,4 @@
1
+ # git-userhub-linux-arm64
2
+ This package contains the native binary for git-userhub on linux arm64.
3
+
4
+ This is an internal package and shouldn't be installed directly. Install `git-userhub` instead.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "git-userhub-linux-arm64",
3
+ "version": "3.0.6",
4
+ "description": "The linux arm64 binary for git-userhub",
5
+ "os": [
6
+ "linux"
7
+ ],
8
+ "cpu": [
9
+ "arm64"
10
+ ],
11
+ "bin": {
12
+ "git-user": "bin/git-user"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/divyo-argha/git-user.git"
17
+ },
18
+ "license": "MIT"
19
+ }
@@ -0,0 +1,4 @@
1
+ # git-userhub-linux-x64
2
+ This package contains the native binary for git-userhub on linux x64.
3
+
4
+ This is an internal package and shouldn't be installed directly. Install `git-userhub` instead.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "git-userhub-linux-x64",
3
+ "version": "3.0.6",
4
+ "description": "The linux x64 binary for git-userhub",
5
+ "os": [
6
+ "linux"
7
+ ],
8
+ "cpu": [
9
+ "x64"
10
+ ],
11
+ "bin": {
12
+ "git-user": "bin/git-user"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/divyo-argha/git-user.git"
17
+ },
18
+ "license": "MIT"
19
+ }
@@ -0,0 +1,4 @@
1
+ # git-userhub-windows-x64
2
+ This package contains the native binary for git-userhub on win32 x64.
3
+
4
+ This is an internal package and shouldn't be installed directly. Install `git-userhub` instead.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "git-userhub-windows-x64",
3
+ "version": "3.0.6",
4
+ "description": "The win32 x64 binary for git-userhub",
5
+ "os": [
6
+ "win32"
7
+ ],
8
+ "cpu": [
9
+ "x64"
10
+ ],
11
+ "bin": {
12
+ "git-user": "bin/git-user.exe"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/divyo-argha/git-user.git"
17
+ },
18
+ "license": "MIT"
19
+ }