Skip to content

Commit

Permalink
Move scripts and bootstrap into fireplace
Browse files Browse the repository at this point in the history
Necessary for scripts to be callable from setup.py install (they must be part of package)

Part of jleclanche#318
  • Loading branch information
smallnamespace committed Feb 24, 2016
1 parent 108384a commit 3edc802
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cache:
- $HOME/virtualenv/python3.5
script:
# Travis will automatically detect requirements.txt and run pip install
- ./bootstrap
- fireplace/bootstrap
- ./setup.py install
- py.test
notifications:
Expand Down
4 changes: 2 additions & 2 deletions bootstrap → fireplace/bootstrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:; ./scripts/bootstrap.sh; exit $?
:; $(dirname $0)/scripts/bootstrap.sh; exit $?
@echo off
@where Powershell.exe
if %ERRORLEVEL% neq 0 (
echo Please install Powershell from https://www.microsoft.com/en-us/download/details.aspx?id=40855
) ELSE (
Powershell.exe -executionpolicy remotesigned -File scripts/bootstrap.ps1
Powershell.exe -executionpolicy remotesigned -File %~dp0scripts\bootstrap.ps1
)
2 changes: 1 addition & 1 deletion scripts/bootstrap.ps1 → fireplace/scripts/bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$BASEDIR=Split-Path $script:MyInvocation.MyCommand.Path
$HSDATA_URL="https://github.com/HearthSim/hs-data.git"
$HSDATA_DIR="$BASEDIR/hs-data"
$CARDDEFS_OUT="$BASEDIR/../fireplace/CardDefs.xml"
$CARDDEFS_OUT="$BASEDIR/../CardDefs.xml"

# check python version
$PY_MAJOR=$(python -c 'import sys; print(sys.version_info[0])')
Expand Down
3 changes: 2 additions & 1 deletion scripts/bootstrap.py → fireplace/scripts/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import os
import re
import sys; sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sys; sys.path.append(
os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
from xml.dom import minidom
from xml.etree import ElementTree
from hearthstone.enums import GameTag
Expand Down
4 changes: 2 additions & 2 deletions scripts/bootstrap.sh → fireplace/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BASEDIR="$(dirname $0)"
HSDATA_URL="https://github.com/HearthSim/hs-data.git"
HSDATA_DIR="$BASEDIR/hs-data"
CARDDEFS_OUT="$BASEDIR/../fireplace/CardDefs.xml"
CARDDEFS_OUT="$BASEDIR/../CardDefs.xml"

# check python version
PY_MAJOR=$(python -c 'import sys; print(sys.version_info[0])')
Expand All @@ -20,7 +20,7 @@ command -v git &>/dev/null || {
}

python -c "import hearthstone" &>/dev/null || {
pip install -r "$BASEDIR/../requirements.txt"
pip install -r "$BASEDIR/../../requirements.txt"
}

echo "Fetching data files from $HSDATA_URL"
Expand Down

0 comments on commit 3edc802

Please sign in to comment.