freecode-sh 0.1.0-alpha.18 → 0.1.0-alpha.19

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/freecode.mjs CHANGED
@@ -6,6 +6,7 @@ import { access, readFile, realpath } from 'node:fs/promises'
6
6
  import { homedir } from 'node:os'
7
7
  import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
8
8
  import { fileURLToPath } from 'node:url'
9
+ import { withoutPowerShellModulePath } from './npm-bootstrap-environment.mjs'
9
10
 
10
11
  const packageDirectory = dirname(fileURLToPath(import.meta.url))
11
12
  const bootstrapPath = fileURLToPath(import.meta.url)
@@ -61,12 +62,17 @@ if (nativeVersion && compareAlphaVersions(nativeVersion, packageMetadata.version
61
62
  args: ['-NoLogo', '-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', join(packageDirectory, 'install.ps1'), '-Version', packageMetadata.version],
62
63
  }
63
64
  : { command: '/bin/sh', args: [join(packageDirectory, 'install.sh'), '--version', packageMetadata.version] }
64
- const installStatus = await run(installer.command, installer.args, {
65
+ const installerEnvironment = {
65
66
  ...process.env,
66
67
  FREECODE_INSTALL_ROOT: installRoot,
67
68
  FREECODE_BIN_DIR: binDirectory,
68
69
  FREECODE_INSTALL_EMBEDDED: 'true',
69
- })
70
+ }
71
+ const installStatus = await run(
72
+ installer.command,
73
+ installer.args,
74
+ windows ? withoutPowerShellModulePath(installerEnvironment) : installerEnvironment,
75
+ )
70
76
  if (installStatus !== 0) process.exit(installStatus)
71
77
  nativeVersion = await managedNativeVersion(nativeExecutable, installRoot, platform)
72
78
  if (!nativeVersion || compareAlphaVersions(nativeVersion, packageMetadata.version) < 0) {
@@ -0,0 +1,7 @@
1
+ export function withoutPowerShellModulePath(environment) {
2
+ const clean = { ...environment }
3
+ for (const key of Object.keys(clean)) {
4
+ if (key.toLowerCase() === 'psmodulepath') delete clean[key]
5
+ }
6
+ return clean
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freecode-sh",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.1.0-alpha.19",
4
4
  "description": "A free coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Free Code",
@@ -27,6 +27,7 @@
27
27
  "files": [
28
28
  "check-platform.mjs",
29
29
  "freecode.mjs",
30
+ "npm-bootstrap-environment.mjs",
30
31
  "install.sh",
31
32
  "install.ps1"
32
33
  ],