Skip to content

Instantly share code, notes, and snippets.

@GhostTypes
Created October 23, 2022 02:46
Show Gist options
  • Select an option

  • Save GhostTypes/93eb5f62366cfd381df6d9496655fb0f to your computer and use it in GitHub Desktop.

Select an option

Save GhostTypes/93eb5f62366cfd381df6d9496655fb0f to your computer and use it in GitHub Desktop.
Build Meteor when the site is down
#Stop being lazy
function DownloadAndBuild() {
$zip_dl = "https://github.com/MeteorDevelopment/meteor-client/archive/refs/heads/master.zip"
$zip_out = Join-Path $PWD "meteor_src.zip"
$unzip_out = Join-Path $PWD "meteor_source"
try {
Write-Host -ForegroundColor Blue "Downloading meteor source from Github..."
Invoke-RestMethod -Uri $zip_dl -OutFile $zip_out
}
catch {
Write-Host -ForegroundColor Red "Unable to download source from Github."
return;
}
try {
Write-Host -ForegroundColor Blue "Unzipping source..."
Expand-Archive -LiteralPath $zip_out -DestinationPath $unzip_out
}
catch {
Write-Host -ForegroundColor Red "Unable to unzip source."
return
}
$unzip_root = Join-Path $unzip_out "meteor-client-master"
$gradlew = Join-Path $unzip_root "gradlew.bat"
if (Test-Path $gradlew) {
Write-Host -ForegroundColor Blue "Building Meteor Client..."
Set-Location -LiteralPath $unzip_root
./gradlew.bat build
$o = Join-Path $unzip_root "\build\libs"
explorer.exe $o
} else {
Write-Host -ForegroundColor Red "Unable to build source."
}
}
DownloadAndBuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment