Page MenuHomeDevCentral

D3581.id9216.diff
No OneTemporary

D3581.id9216.diff

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@
cd tests/site && \
cp ../../config.yml . && \
cp -Rp ../../template/* . && \
- make
+ PACKAGE_TEMPLATE=../../components/package-template.json UPSECTION=../../src/upsection.py make
publish:
upsection package.json
diff --git a/src/upsection.py b/src/upsection.py
--- a/src/upsection.py
+++ b/src/upsection.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import json
+import os
import sys
import yaml
@@ -10,7 +11,14 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-PACKAGE_TEMPLATE = "/usr/local/share/upsection/package-template.json"
+DEFAULT_PACKAGE_TEMPLATE_PATH = "/usr/local/share/upsection/package-template.json"
+
+
+def get_package_template_path():
+ try:
+ return os.environ["PACKAGE_TEMPLATE"]
+ except KeyError:
+ return DEFAULT_PACKAGE_TEMPLATE_PATH
def get_builders():
@@ -26,7 +34,7 @@
def build_package():
- with open(PACKAGE_TEMPLATE) as fd:
+ with open(get_package_template_path()) as fd:
package_template = json.load(fd)
package = {
diff --git a/template/Makefile b/template/Makefile
--- a/template/Makefile
+++ b/template/Makefile
@@ -1,6 +1,7 @@
CP=cp
RM=rm -rf
SOURCE=/usr/local/share/upsection
+UPSECTION ?= upsection
# -------------------------------------------------------------
# Main targets
@@ -23,10 +24,10 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
package.json:
- upsection package.json
+ ${UPSECTION} package.json
.browserslistrc:
- upsection .browserslistrc
+ ${UPSECTION} .browserslistrc
node_modules: package.json
npm install

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 09:52 (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249727
Default Alt Text
D3581.id9216.diff (1 KB)

Event Timeline