Skip to content

Commit

Permalink
Handle windows python
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Jul 26, 2018
1 parent bfcbb0c commit 60c3fa7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python/dist/*: $(BUILD_DIR)/python $(wildcard python/**/*.py) python/jsbeautifie
rm -f python/dist/*
@cd python && \
$(PYTHON) setup.py sdist
./build/python-rel/bin/pip install -U python/dist/*
$(SCRIPT_DIR)/python-rel pip install -U python/dist/*

# Test generation
$(BUILD_DIR)/generate: $(BUILD_DIR)/node test/generate-tests.js $(wildcard test/data/**/*)
Expand All @@ -92,8 +92,7 @@ $(BUILD_DIR)/node: package.json package-lock.json | $(BUILD_DIR)

$(BUILD_DIR)/python: python/setup.py | $(BUILD_DIR) $(BUILD_DIR)/virtualenv
@$(PYTHON) --version
ls -alR ./build
./build/python-dev/bin/pip install -e ./python
$(SCRIPT_DIR)/python-dev pip install -e ./python
@touch $(BUILD_DIR)/python

$(BUILD_DIR)/virtualenv: | $(BUILD_DIR)
Expand Down
8 changes: 4 additions & 4 deletions python/jsbeautifier/tests/shell-smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ test_smoke_js_beautify()
{
echo ----------------------------------------
echo Testing beautify functionality...
$SCRIPT_DIR/../../js-beautify-test.py || exit 1
$SCRIPT_DIR/../../../tools/python-dev python $SCRIPT_DIR/../../js-beautify-test.py || exit 1
}

test_perf_js_beautify()
Expand All @@ -326,11 +326,11 @@ main() {

#test_cli_common css-beautify
#test_cli_common html-beautify
test_cli_common js-beautify $SCRIPT_DIR/../../../build/python-dev/bin/js-beautify
test_cli_common js-beautify $SCRIPT_DIR/../../../build/python-rel/bin/js-beautify
test_cli_common js-beautify "$SCRIPT_DIR/../../../tools/python-dev js-beautify"
test_cli_common js-beautify "$SCRIPT_DIR/../../../tools/python-rel js-beautify"


test_cli_js_beautify $SCRIPT_DIR/../../../build/python-dev/bin/js-beautify
test_cli_js_beautify "$SCRIPT_DIR/../../../tools/python-dev js-beautify"
test_perf_js_beautify

echo ----------------------------------------
Expand Down
16 changes: 16 additions & 0 deletions tools/python-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

REL_SCRIPT_DIR="`dirname \"$0\"`"
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
PROJECT_DIR="`( cd \"$SCRIPT_DIR/..\" && pwd )`"
PYTHON_ENV=python-dev

if [ -d "$PROJECT_DIR/build/$PYTHON_ENV/Scripts" ]; then
RUN_FILE="$PROJECT_DIR/build/$PYTHON_ENV/Scripts/$1"
else
RUN_FILE="$PROJECT_DIR/build/$PYTHON_ENV/bin/$1"
fi

shift

$RUN_FILE $@
16 changes: 16 additions & 0 deletions tools/python-rel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

REL_SCRIPT_DIR="`dirname \"$0\"`"
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
PROJECT_DIR="`( cd \"$SCRIPT_DIR/..\" && pwd )`"
PYTHON_ENV=python-rel

if [ -d "$PROJECT_DIR/build/$PYTHON_ENV/Scripts" ]; then
RUN_FILE="$PROJECT_DIR/build/$PYTHON_ENV/Scripts/$1"
else
RUN_FILE="$PROJECT_DIR/build/$PYTHON_ENV/bin/$1"
fi

shift

$RUN_FILE $@

0 comments on commit 60c3fa7

Please sign in to comment.