git-userhub 2.1.4 → 2.1.5

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 (2) hide show
  1. package/install.js +12 -4
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -114,13 +114,21 @@ async function install() {
114
114
  console.log(`🔍 Fetching release v${pkg.version}...`);
115
115
  const release = await getRelease();
116
116
 
117
- // Find the right asset
118
- const assetName = `git-user_${osName}_${arch}.tar.gz`;
119
- const asset = release.assets.find(a => a.name === assetName);
117
+ // Find the right asset dynamically
118
+ const asset = release.assets.find(a => {
119
+ const name = a.name.toLowerCase();
120
+ if (!name.includes(osName)) return false;
121
+
122
+ if (arch === 'arm64') {
123
+ return name.includes('arm64');
124
+ } else {
125
+ return name.includes('x86_64') || name.includes('amd64') || name.includes('x64');
126
+ }
127
+ });
120
128
 
121
129
  if (!asset) {
122
130
  console.error('❌ No binary found for your platform');
123
- console.error(` Looking for: ${assetName}`);
131
+ console.error(` Looking for a ${osName} binary matching architecture: ${arch}`);
124
132
  process.exit(1);
125
133
  }
126
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-userhub",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
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"