PortValhalla/scripts/Windows/Software/git/Manage.ps1
2023-07-27 01:07:20 +02:00

25 lines
726 B
PowerShell

#!/bin/pwsh
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
function Backup-Git([Context] $context) {}
function Restore-Git([Context] $context) {
Write-Host "Restoring git";
$script = New-TemporaryFile;
$script = Rename-Item $script "$($script.Name).sh" -PassThru;
Write-Information "Preparing setup script";
Set-Content $script (
[string]::Join(
"`n",
@(
"bash `"$PSScriptRoot/../../../Common/Config/git/install.sh`"",
"bash rm ~/.bashrc")));
Write-Information "Running prepared script";
Start-Process -Wait $script;
Remove-Item $script;
}
}