Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Restore options subdirectory variable

Jo Sprague705e3f3a6e82
diff --git a/bin/wv-options-build b/bin/wv-options-build
index 92e014427..0d1548cae 100755
--- a/bin/wv-options-build
+++ b/bin/wv-options-build
@@ -24,14 +24,18 @@ die() {
[ -d "$SRC_DIR" ] || die "Options directory does not exist"
+# Set $OPT_SUBDIR to the first argument passed into this script
+# Or "release" if there is no argument passed
+OPT_SUBDIR="${1-release}"
+
# Activate virtual Python environment
PATH=.python/bin:.python/Scripts:${PATH}
# If $FETCH_GC is set fetch GetCapabilities
if [ "$FETCH_GC" ] ; then
- rm -rf "$OPT_DIR/release/gc/*"
- rm -rf "$OPT_DIR/release/colormaps/gc/*"
- "$BIN_DIR/wv-options-fetch" "$OPT_DIR/release/config.json" "$OPT_DIR/release/gc"
+ rm -rf "$OPT_DIR/$OPT_SUBDIR/gc/*"
+ rm -rf "$OPT_DIR/$OPT_SUBDIR/colormaps/gc/*"
+ "$BIN_DIR/wv-options-fetch" "$OPT_DIR/$OPT_SUBDIR/config.json" "$OPT_DIR/$OPT_SUBDIR/gc"
exit 0
fi
@@ -42,9 +46,9 @@ mkdir -p "$BUILD_DIR" "$DEST_DIR"
cp -r "$SRC_DIR"/common/* "$BUILD_DIR"
if hash rsync 2>/dev/null; then
- rsync -a "$SRC_DIR/release"/* "$BUILD_DIR"
+ rsync -a "$SRC_DIR/$OPT_SUBDIR"/* "$BUILD_DIR"
else
- cp -r "$SRC_DIR/release"/* "$BUILD_DIR"
+ cp -r "$SRC_DIR/$OPT_SUBDIR"/* "$BUILD_DIR"
fi
mkdir -p "$DEST_DIR/config"
@@ -66,7 +70,7 @@ if [ -e "$BUILD_DIR/colormaps" ] ; then
if [ -d "$BUILD_DIR"/gc/colormaps ] ; then
cp -r "$BUILD_DIR"/gc/colormaps "$BUILD_DIR"/colormaps/gc
fi
- "$BIN_DIR/wv-options-colormap" "$OPT_DIR/release/config.json" \
+ "$BIN_DIR/wv-options-colormap" "$OPT_DIR/$OPT_SUBDIR/config.json" \
"$BUILD_DIR/colormaps" \
"$BUILD_DIR/config/palettes"
fi