From 00701ef312fb4fa2fb6b873fee8e9b4c28a9c8fe Mon Sep 17 00:00:00 2001 From: TitanSnow Date: Sat, 22 Apr 2017 11:12:48 +0800 Subject: pull on Windows! --- scripts/get.ps1 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get.ps1 b/scripts/get.ps1 index aec656a69..298ae479a 100644 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -2,7 +2,8 @@ # usage: (in powershell) # Invoke-Expression (Invoke-Webrequest -UseBasicParsing).Content -$outfile=($env:TMP,$env:TEMP,'.' -ne $null)[0]+"\$pid-xmake-installer.exe" +$temppath=($env:TMP,$env:TEMP,'.' -ne $null)[0] +$outfile=$temppath+"\$pid-xmake-installer.exe" try{ Write-Output "$pid"|Out-File -FilePath "$outfile" Remove-Item "$outfile" @@ -36,3 +37,27 @@ Write-Host 'Adding to PATH... almost done' $env:Path+=";$installdir" [Environment]::SetEnvironmentVariable("Path",[Environment]::GetEnvironmentVariable("Path",[System.EnvironmentVariableTarget]::User)+";$installdir",[System.EnvironmentVariableTarget]::User) # this step is optional because installer writes path to regedit xmake --version +$branch='master' +Write-Host "Pulling xmake from branch $branch" +$outfile=$temppath+"\$pid-xmake-repo.zip" +try{ + Invoke-Webrequest "https://github.com/tboox/xmake/archive/$branch.zip" -OutFile "$outfile" +}catch{ + Write-Host 'Pull Failed!' + Write-Host 'xmake is now available but may not be newest' + Exit +} +Write-Host 'Expanding archive...' +New-Item -Path "$temppath" -Name "$pid-xmake-repo" -ItemType "directory" -Force +$repodir=$temppath+"\$pid-xmake-repo" +Expand-Archive "$outfile" "$repodir" -Force +Write-Host 'Self-building...' +$oldpwd=$pwd +Set-Location ($repodir+"\xmake-$branch\core") +xmake +Write-Host 'Copying new files...' +Copy-Item 'build\xmake.exe' "$installdir" -Force +Set-Location '..\xmake' +Copy-Item * "$installdir" -Recurse -Force +Set-Location "$oldpwd" +xmake --version -- cgit v1.3.1