Skip to content

Commit

Permalink
Allow install of chezmoi from a powershell where StrictMode is on
Browse files Browse the repository at this point in the history
Currently, if, ie, the currently running context has called:

   Set-StrictMode -version latest

...then install.ps1 will error when, ie,

`[Runtime.InteropServices.RuntimeInformation]::OSArchitecture`
 in `get_goarch` is fetched from .NET 4.0.

This change won't affect the calling context.
  • Loading branch information
pmolodo committed Jul 14, 2021
1 parent f27a0ea commit acc950d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ function Install-Chezmoi {
[string[]]$ExecArgs
)

# some sub-functions (ie, get_goarch, likely others) require fetching of
# non-existent properites to not error
Set-StrictMode -off

# $BinDir = Resolve-Path $BinDir

$os = get_goos
Expand Down

0 comments on commit acc950d

Please sign in to comment.