Skip to content

Commit

Permalink
Merge pull request #109 from HPI-SWA-Lab/buildscript-pythonpath
Browse files Browse the repository at this point in the history
supply PYTHONPATH to the terminal started from .build/shell.py
  • Loading branch information
timfel committed Sep 28, 2015
2 parents 764e019 + b2b0ce3 commit 9623e2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .build/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
import environment, code
print "\033[33;5;7m \nUse terminal() to drop into a system console\n \033[0m"
def terminal():
module_path = os.path.abspath(os.path.dirname(__file__))
if module_path in sys.path:
paths = sys.path[:sys.path.index(module_path)]
else:
paths = sys.path
os.putenv("PYTHONPATH", os.pathsep.join(paths))
os.system(os.environ.get("COMSPEC") or os.environ.get("SHELL") or "/bin/sh")
code.interact(local=locals())

0 comments on commit 9623e2c

Please sign in to comment.