mirror of
https://github.com/prime31/FNA-VSCode-Template.git
synced 2025-10-31 21:50:44 +07:00
Added Powershell scripts for Windows
This commit is contained in:
parent
af4391b54c
commit
99aacd20b7
34
getFNA_Win.ps1
Normal file
34
getFNA_Win.ps1
Normal file
@ -0,0 +1,34 @@
|
||||
# getFNA_Win
|
||||
# Clones/pulls the latest FNA from Github for use as a project reference.
|
||||
# Usage: ./getFNA_Win.bat
|
||||
|
||||
git --version > $null
|
||||
if ( -Not $? ) {
|
||||
Write-Error "ERROR: Git is required to pull FNA from the command line."
|
||||
Write-Output "Either install git or download and unzip FNA manually."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Downloading
|
||||
if ( -Not (Test-Path -Path "FNA") ) {
|
||||
Write-Output "Cloning FNA..."
|
||||
git clone https://github.com/FNA-XNA/FNA.git --recursive
|
||||
if ($?) {
|
||||
Write-Output "Finished cloning!"
|
||||
}
|
||||
else {
|
||||
Write-Error "ERROR: Unable to clone successfully. Maybe try again later?"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Output "Pulling the latest git version of FNA..."
|
||||
git -C FNA pull --recurse-submodules
|
||||
if ($?) {
|
||||
Write-Output "Finished updating!"
|
||||
}
|
||||
else {
|
||||
Write-Error "ERROR: Unable to update."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Unzipping
|
||||
# Decompressing
|
||||
echo "Decompressing fnalibs..."
|
||||
mkdir fnalibs
|
||||
tar xjC fnalibs -f fnalibs.tar.bz2
|
||||
|
||||
34
getLibs_Win.ps1
Normal file
34
getLibs_Win.ps1
Normal file
@ -0,0 +1,34 @@
|
||||
# getLibs_Win
|
||||
# Downloads and untars the latest archive of pre-compiled native libraries for FNA.
|
||||
# Note: This requires 7-Zip to be installed.
|
||||
# Usage: ./getLibs
|
||||
|
||||
# Downloading
|
||||
Write-Output "Downloading latest fnalibs..."
|
||||
Invoke-WebRequest -Uri http://fna.flibitijibibo.com/archive/fnalibs.tar.bz2 -OutFile fnalibs.tar.bz2
|
||||
if ($?) {
|
||||
Write-Output "Finished downloading!"
|
||||
}
|
||||
else {
|
||||
Write-Error "ERROR: Unable to download successfully. Maybe try again later?"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Is 7Zip installed?
|
||||
# Edit this to be Program Files (x86) if you installed the 32-bit version.
|
||||
$7zip = 'C:\Program Files\7-Zip\7z.exe'
|
||||
& $7zip >$null
|
||||
if (-Not $?)
|
||||
{
|
||||
Write-Error "7Zip is required to decompress fnalibs."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Decompress
|
||||
& $7zip x -y fnalibs.tar.bz2 >$null
|
||||
& $7zip x -y fnalibs.tar -o* >$null
|
||||
|
||||
Remove-Item fnalibs.tar.bz2
|
||||
Remove-Item fnalibs.tar
|
||||
|
||||
Write-Output "fnalibs extracted!"
|
||||
Loading…
Reference in New Issue
Block a user