You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Server/updateSubmodule.ps1

30 lines
627 B

param (
[switch]$md = $false
)
Write-Host "Checking for submodule path..."
if (-not(Test-Path Gamelib)) {
Write-Host "Path Gamelib doesn't exist.";
if (-not($md)) {
Write-Host "Exiting.";
Write-Host "If you want to automatically create the subdirectory,";
Write-Host "please pass the flag -md";
exit;
}
New-Item -Path Gamelib -Type Directory;
}
Write-Host "Updating submodule..."
try {
git submodule update --init;
Set-Location Gamelib;
git fetch;
git status;
git checkout gamelib;
git pull;
Set-Location ..;
Write-Host "Update done.";
} catch {
Write-Host "There's been an error. Is Git installed?";
}