git-userhub 3.0.9 → 3.0.10

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.
Binary file
package/bin/git-user.js CHANGED
@@ -12,19 +12,28 @@ const ext = platform === 'win32' ? '.exe' : '';
12
12
  const finalBinaryName = `git-user-${platform}-${arch}${ext}`;
13
13
  const finalBinaryPath = path.join(__dirname, finalBinaryName);
14
14
 
15
- if (!fs.existsSync(finalBinaryPath)) {
16
- console.error(`❌ git-user binary not found at ${finalBinaryPath}`);
17
- console.error('Please reinstall the package: npm install -g git-userhub');
18
- process.exit(1);
19
- }
15
+ async function run() {
16
+ if (!fs.existsSync(finalBinaryPath)) {
17
+ console.log('📦 First run detected. Downloading binary...');
18
+ const install = require('../scripts/install.js');
19
+ try {
20
+ await install();
21
+ } catch (e) {
22
+ console.error('❌ Failed to install git-user binary.');
23
+ process.exit(1);
24
+ }
25
+ }
26
+
27
+ const child = spawn(finalBinaryPath, process.argv.slice(2), {
28
+ stdio: 'inherit',
29
+ shell: false
30
+ });
20
31
 
21
- const child = spawn(finalBinaryPath, process.argv.slice(2), {
22
- stdio: 'inherit',
23
- shell: false
24
- });
32
+ child.on('exit', (code) => process.exit(code || 0));
33
+ child.on('error', (err) => {
34
+ console.error('❌ Failed to start git-user:', err.message);
35
+ process.exit(1);
36
+ });
37
+ }
25
38
 
26
- child.on('exit', (code) => process.exit(code || 0));
27
- child.on('error', (err) => {
28
- console.error('❌ Failed to start git-user:', err.message);
29
- process.exit(1);
30
- });
39
+ run();
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "git-userhub",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
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/inject-hashes.js",
11
- "postinstall": "node scripts/install.js"
10
+ "prepublishOnly": "node scripts/inject-hashes.js"
12
11
  },
13
12
  "keywords": [
14
13
  "git",
@@ -45,8 +44,5 @@
45
44
  ],
46
45
  "config": {
47
46
  "repo": "divyo-argha/git-user"
48
- },
49
- "dependencies": {
50
- "tar": "^7.5.16"
51
47
  }
52
- }
48
+ }