fuzzrunx 0.1.3 → 0.1.4

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/package.json +1 -1
  2. package/src/installer.js +15 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuzzrunx",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Auto-correct mistyped commands and subcommands and re-run them safely.",
5
5
  "bin": {
6
6
  "fuzzrun": "bin/fuzzrun.js"
package/src/installer.js CHANGED
@@ -27,10 +27,21 @@ function getBinPath(packageRoot) {
27
27
  function getProfileTargets() {
28
28
  const home = os.homedir();
29
29
  if (process.platform === 'win32') {
30
- return [
31
- path.join(home, 'Documents', 'PowerShell', 'Microsoft.PowerShell_profile.ps1'),
32
- path.join(home, 'Documents', 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1')
33
- ];
30
+ const roots = new Set([path.join(home, 'Documents')]);
31
+ const oneDriveRoots = [
32
+ process.env.OneDrive,
33
+ process.env.OneDriveConsumer,
34
+ process.env.OneDriveCommercial
35
+ ].filter(Boolean);
36
+ for (const root of oneDriveRoots) {
37
+ roots.add(path.basename(root).toLowerCase() === 'documents' ? root : path.join(root, 'Documents'));
38
+ }
39
+ const targets = [];
40
+ for (const root of roots) {
41
+ targets.push(path.join(root, 'PowerShell', 'Microsoft.PowerShell_profile.ps1'));
42
+ targets.push(path.join(root, 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1'));
43
+ }
44
+ return [...new Set(targets)];
34
45
  }
35
46
  return [path.join(home, '.bashrc'), path.join(home, '.zshrc')];
36
47
  }