Skip to content

Commit c5dfe29

Browse files
author
Cerem Cem ASLAN
committed
cleanup by moving variables into a single file
1 parent baf1e1b commit c5dfe29

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
VENV_NAME := scadajs1
1+
DIR:=$(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
2+
3+
include $(DIR)/venv-version.txt
4+
VENV_NAME := $(VENV_NAME)
5+
$(eval VENV_PATH := $(shell echo "$$$(VENV_VERSION)"))
26
APP := main
37
CONFIG := ../dcs-modules.txt
48

9+
__test_variables:
10+
@echo $(VENV_VERSION) path is set to $(VENV_PATH)
11+
512
.PHONY: test-es6-compat update-deps update-app-version
613

714
# Check if we are in a VIRTUAL_ENV:
@@ -56,7 +63,7 @@ freeze-venv: __c
5663
freeze ./requirements.txt
5764

5865
create-venv:
59-
$(if $(SCADAJS_1_ENV),$(error SCADAJS_1_ENV variable is set, use it instead: $(SCADAJS_1_ENV)))
66+
$(if $(VENV_PATH),$(error $(VENV_VERSION) variable is set, use it instead: $(VENV_PATH)))
6067
$(eval NODE_VERSION := $(shell echo `grep "^#node@" nodeenv.txt | cut -d@ -f2` | sed 's/^$$/system/'))
6168
nodeenv --requirement=./nodeenv.txt --node=$(NODE_VERSION) --prompt="($(VENV_NAME))" --jobs=4 nodeenv
6269

venv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ set -e -o pipefail
1111
safe_source () { [[ ! -z ${1:-} ]] && source $1; _dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; _sdir=$(dirname "$(readlink -f "$0")"); }; safe_source
1212
_sdir=$(dirname $(realpath ${BASH_SOURCE[0]}))
1313

14-
ENV_VERSION="SCADAJS_1_ENV"
14+
source $_sdir/venv-version.txt
15+
16+
ENV_VERSION="$VENV_VERSION"
1517
VENV_PATH=
1618
LOCAL_VENV="$_sdir/nodeenv"
1719

venv-version.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#VENV_NAME=scadajs2
2+
#VENV_VERSION=SCADAJS_2_ENV
3+
VENV_NAME=scadajs1
4+
VENV_VERSION=SCADAJS_1_ENV

0 commit comments

Comments
 (0)