File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ $ScriptDir = Split-Path $script :MyInvocation.MyCommand.Path
2
+ $DataDir = " $ScriptDir /fireplace/cards/data"
3
+ $HsdataDir = " $ScriptDir /hs-data"
4
+ $HsdataUrl = " https://github.com/HearthSim/hs-data.git"
5
+
6
+ # check python version
7
+ $PyMajor = $ (python - c ' import sys; print(sys.version_info[0])' )
8
+ $PyMinor = $ (python - c ' import sys; print(sys.version_info[1])' )
9
+
10
+ if ($PyMajor -lt 3 ) {
11
+ Throw " ERROR: Python 3 and above is required to run Fireplace."
12
+ }
13
+
14
+ if ($PyMinor -lt 4 ) {
15
+ Write-Error " WARNING: Python versions older than 3.4 are known to have issues."
16
+ }
17
+
18
+ Write-Output " Fetching data files from $HsdataUrl "
19
+ if (! (Test-Path $HsdataDir )) {
20
+ git clone -- depth= 1 $HsdataUrl $HsdataDir
21
+ } else {
22
+ git - C $HsdataDir fetch | Write-Output
23
+ if ($? ) {
24
+ git - C $HsdataDir reset -- hard origin/ master | Write-Output
25
+ }
26
+ }
27
+
28
+ python " $DataDir /__init__.py" $HsdataDir " $DataDir /CardDefs.xml"
You can’t perform that action at this time.
0 commit comments