diff --git a/scripts/Setup-DevEnvironment.ps1 b/scripts/Setup-DevEnvironment.ps1 new file mode 100644 index 0000000..fc6aaa4 --- /dev/null +++ b/scripts/Setup-DevEnvironment.ps1 @@ -0,0 +1,2 @@ +. "$PSScriptRoot/Setup-Submodule.ps1" +. "$PSScriptRoot/Setup-SslCertificate" \ No newline at end of file diff --git a/scripts/Setup-Submodule.ps1 b/scripts/Setup-Submodule.ps1 new file mode 100644 index 0000000..24cfc4a --- /dev/null +++ b/scripts/Setup-Submodule.ps1 @@ -0,0 +1,16 @@ +Function Invoke-Git { + [CmdletBinding()] + Param( + [string[]] $Arguments + ) + + # We are invoking git through cmd here because otherwise the redirection does not process until after git has completed, leaving errors in the stream. + Write-Host "git $Arguments" + & cmd /c "git $Arguments 2>&1" +} + +Write-Host 'Resetting submodules' +Invoke-Git -Arguments ('submodule', 'deinit', '--all', '-f') + +Write-Host "Updating submodules" +Invoke-Git -Arguments ('submodule', 'update', '--init', '--') \ No newline at end of file