Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3750829
D3581.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3581.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 03:47 (19 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249727
Default Alt Text
D3581.id.diff (1 KB)
Attached To
Mode
D3581: Harden test site build
Attached
Detach File
Event Timeline
Log In to Comment