Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Powershell equivalent to boostrap.sh
Directly port boostrap.sh to Powershell to make things slightly nicer
for Windows devs.
  • Loading branch information
liujimj committed Oct 7, 2015
1 parent c5fa2eb commit 5fd3b1c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bootstrap.ps1
@@ -0,0 +1,28 @@
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
$DataDir = "$ScriptDir/fireplace/cards/data"
$HsdataDir = "$ScriptDir/hs-data"
$HsdataUrl = "https://github.com/HearthSim/hs-data.git"

# check python version
$PyMajor = $(python -c 'import sys; print(sys.version_info[0])')
$PyMinor = $(python -c 'import sys; print(sys.version_info[1])')

if ($PyMajor -lt 3) {
Throw "ERROR: Python 3 and above is required to run Fireplace."
}

if ($PyMinor -lt 4) {
Write-Error "WARNING: Python versions older than 3.4 are known to have issues."
}

Write-Output "Fetching data files from $HsdataUrl"
if (!(Test-Path $HsdataDir)) {
git clone --depth=1 $HsdataUrl $HsdataDir
} else {
git -C $HsdataDir fetch | Write-Output
if ($?) {
git -C $HsdataDir reset --hard origin/master | Write-Output
}
}

python "$DataDir/__init__.py" $HsdataDir "$DataDir/CardDefs.xml"

0 comments on commit 5fd3b1c

Please sign in to comment.