voidconnect 0.1.10 → 0.1.12

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 +17 -0
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -105,6 +105,23 @@ function extract(file, dest, extension, binary) {
105
105
  } catch (error) {
106
106
  throw error;
107
107
  }
108
+
109
+ // Add to PATH on Windows if not present
110
+ if (os.platform() === 'win32') {
111
+ try {
112
+ const userPath = execSync('powershell -Command "[Environment]::GetEnvironmentVariable(\'Path\', [EnvironmentVariableTarget]::User)"', { encoding: 'utf8' }).trim();
113
+ if (!userPath.includes(dest)) {
114
+ const newPath = `${userPath};${dest}`;
115
+ // Powershell command to set the new path
116
+ const setPathCmd = `[Environment]::SetEnvironmentVariable("Path", "${newPath}", [EnvironmentVariableTarget]::User)`;
117
+ execSync(`powershell -Command "${setPathCmd}"`);
118
+ console.log(`Added ${dest} to user PATH.`);
119
+ console.log('You may need to restart your terminal for changes to take effect.');
120
+ }
121
+ } catch (err) {
122
+ console.warn('Failed to add to PATH:', err.message);
123
+ }
124
+ }
108
125
  }
109
126
 
110
127
  if (require.main === module) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voidconnect",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "NPM wrapper for voidconnect-cli",
5
5
  "bin": {
6
6
  "voidconnect": "bin/voidconnect.js"