Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44c5631943 | |||
| b78d0a5b80 | |||
| 38620ff9e2 | |||
| 18daaaa0d7 | |||
| 4ee669ebba |
@@ -6,8 +6,6 @@
|
|||||||
{setup, "2.2.1"}
|
{setup, "2.2.1"}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{post_hooks, [{compile, "./zompify.sh"}]}.
|
|
||||||
|
|
||||||
{profiles, [
|
{profiles, [
|
||||||
{test, [{deps, [{meck, "0.9.2"}]}]}
|
{test, [{deps, [{meck, "0.9.2"}]}]}
|
||||||
]}.
|
]}.
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
-export([update_config/1,
|
-export([update_config/1,
|
||||||
update_config/2,
|
update_config/2,
|
||||||
update_config/3,
|
update_config/3,
|
||||||
|
pure_update_config/3,
|
||||||
silent_update_config/1,
|
silent_update_config/1,
|
||||||
delete_config_value/1,
|
delete_config_value/1,
|
||||||
suggest_config/2,
|
suggest_config/2,
|
||||||
@@ -878,6 +879,12 @@ update_config(Map, ConfigMap, Mode) ->
|
|||||||
pt_set_config(ConfigMap1),
|
pt_set_config(ConfigMap1),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
pure_update_config(Map, ConfigMap, Schema) ->
|
||||||
|
NewCfg = gmconfig_schema_utils:merge(Map, ConfigMap, Schema),
|
||||||
|
check_validation([validate_(NewCfg, Schema)],
|
||||||
|
[NewCfg], pure_update_config, silent),
|
||||||
|
NewCfg.
|
||||||
|
|
||||||
export_config() ->
|
export_config() ->
|
||||||
Config = pt_get_config(),
|
Config = pt_get_config(),
|
||||||
JSON = json:format(Config, #{indent => 2}),
|
JSON = json:format(Config, #{indent => 2}),
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
{type,app}.
|
{type,app}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
{prefix,"gmconfig"}.
|
{prefix,"gmconfig"}.
|
||||||
{desc,"Configuration management support"}.
|
|
||||||
{author,"Ulf Wiger"}.
|
{author,"Ulf Wiger"}.
|
||||||
{package_id,{"uwiger","gmconfig",{0,1,0}}}.
|
{desc,"Configuration management support"}.
|
||||||
{deps,[{"uwiger","setup",{2,2,3}}]}.
|
{package_id,{"uwiger","gmconfig",{0,1,2}}}.
|
||||||
|
{deps,[{"uwiger","setup",{2,2,4}}]}.
|
||||||
{key_name,none}.
|
{key_name,none}.
|
||||||
{a_email,"ulf@wiger.net"}.
|
{a_email,"ulf@wiger.net"}.
|
||||||
{c_email,"ulf@wiger.net"}.
|
{c_email,"ulf@wiger.net"}.
|
||||||
|
|||||||
+34
-4
@@ -2,11 +2,41 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
APP=$(basename "$PWD")
|
APP=$(basename "$PWD")
|
||||||
|
|
||||||
SRC="_build/default/lib/$APP"
|
SRC="_build/default/lib/$APP"
|
||||||
DST="$PWD/_build/zomp/lib/$APP"
|
DST="$PWD/_build/zomp/lib/$APP"
|
||||||
|
IGNORE_FILE="zomp.ignore"
|
||||||
|
|
||||||
mkdir -p "$DST"
|
mkdir -p "$DST"
|
||||||
find "$SRC" -type l ! -exec test -e {} \; -delete
|
|
||||||
cp -aR -L "$SRC/." "$DST/"
|
# Remove broken symlinks
|
||||||
|
find "$SRC" -type l ! -exec test -e {} \; -delete || true
|
||||||
|
|
||||||
|
# Build ignore matcher
|
||||||
|
IGNORE_TEMP=$(mktemp)
|
||||||
|
trap "rm -f $IGNORE_TEMP" EXIT
|
||||||
|
|
||||||
|
# Expand globs in zomp.ignore to patterns suitable for grep
|
||||||
|
if [ -e "$IGNORE_FILE" ]; then
|
||||||
|
grep -v '^\s*#' "$IGNORE_FILE" | sed 's#/#\\/#g' | sed 's/\./\\./g' | sed 's/\*/.*/g' > "$IGNORE_TEMP"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy Git-tracked and Zomp-allowed files
|
||||||
|
git ls-files -z | while IFS= read -r -d '' file; do
|
||||||
|
# Skip if ignored
|
||||||
|
echo "$file" | grep -Eq -f "$IGNORE_TEMP" && continue
|
||||||
|
# Only copy if file exists in the build dir
|
||||||
|
if [ -e "$SRC/$file" ]; then
|
||||||
|
mkdir -p "$DST/$(dirname "$file")"
|
||||||
|
cp -a "$SRC/$file" "$DST/$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm "$IGNORE_TEMP"
|
||||||
|
|
||||||
|
# Copy metadata
|
||||||
cp "$PWD/zomp.meta" "$DST/"
|
cp "$PWD/zomp.meta" "$DST/"
|
||||||
cp "$PWD/Emakefile" "$DST"
|
cp "$PWD/Emakefile" "$DST/"
|
||||||
rm "$DST"/ebin/*.beam
|
|
||||||
|
# Clean up beam files just in case
|
||||||
|
[ -d "$DST/ebin" ] && find "$DST/ebin" -name '*.beam' -exec rm -f {} + || true
|
||||||
|
|||||||
Reference in New Issue
Block a user