-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Console bin wrapper, make file, readme updates
- Loading branch information
Showing
3 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Get real directory in case of symlink | ||
if [[ -L "${BASH_SOURCE[0]}" ]] | ||
then | ||
DIR="$( cd "$( dirname $( readlink "${BASH_SOURCE[0]}" ) )" && pwd )" | ||
else | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
fi | ||
cd $DIR | ||
|
||
ENV="$DIR/../env/bin/activate" | ||
if [ ! -f $ENV ]; then | ||
echo 'Virtual Environment Not Installed' | ||
exit -1 | ||
fi | ||
|
||
SCRIPT="$DIR/../screeps_console/interactive.py" | ||
source $ENV | ||
$SCRIPT "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
SHELL:=/bin/bash | ||
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
.PHONY: all fresh dependencies install fulluninstall uninstall removedeps | ||
|
||
all: dependencies | ||
|
||
fresh: fulluninstall dependencies | ||
|
||
fulluninstall: uninstall cleancode | ||
|
||
install: | ||
# Create link in /usr/local/bin to screeps stats program. | ||
ln -s -f $(ROOT_DIR)/bin/screepsconsole.sh /usr/local/bin/screepsconsole | ||
|
||
dependencies: | ||
if [ ! -d $(ROOT_DIR)/env ]; then virtualenv $(ROOT_DIR)/env; fi | ||
source $(ROOT_DIR)/env/bin/activate; yes w | pip install -r $(ROOT_DIR)/requirements.txt | ||
|
||
uninstall: | ||
# Remove screepsstats link in /user/local/bin | ||
if [ -L /usr/local/bin/screepsconsole.sh ]; then \ | ||
rm /usr/local/bin/screepsconsole; \ | ||
fi; | ||
|
||
cleancode: | ||
# Remove existing environment | ||
if [ -d $(ROOT_DIR)/env ]; then \ | ||
rm -rf $(ROOT_DIR)/env; \ | ||
fi; | ||
# Remove compiled python files | ||
if [ -d $(ROOT_DIR)/screep_etl ]; then \ | ||
rm -f $(ROOT_DIR)/screep_etl/*.pyc; \ | ||
fi; |