Runtime checks

- Check for presence of WX when running a GUI app
- Ensure current Erlang runtime matches bytecode on Linux
This commit is contained in:
2022-01-31 20:18:44 +09:00
parent 839f59c321
commit 30f1c04325
56 changed files with 93 additions and 35 deletions
+8 -1
View File
@@ -6,8 +6,15 @@
version=0.12.3
zx="zx-$version"
tarball="$zx.tar.gz"
target="https://zxq9.com/projects/zomp/$tarball"
if command -v wget &> /dev/null
then
wget -nv "$target"
else
curl -s "$target" --output "$tarball"
fi
wget -nv "https://zxq9.com/projects/zomp/$tarball"
tar -zxf "$tarball"
cd "$zx"
chmod +x install
+20 -3
View File
@@ -1,7 +1,7 @@
#! /bin/bash
if [ -f "$HOME/.bash_profile" ]
then
then
. "$HOME"/.bash_profile
fi
@@ -9,12 +9,29 @@ export ZOMP_DIR="${ZOMP_DIR:-$HOME/zomp}"
export ZX_VERSION=$(cat "$ZOMP_DIR/etc/version.txt")
export ZX_DIR="$ZOMP_DIR/lib/otpr/zx/$ZX_VERSION"
last_file="$ZOMP_DIR/last.erts"
if [[ -f "$last_file" ]]
then
last_erts=$(cat "$last_file")
else
last_erts="NONE"
fi
curr_erts=$(erl -version 2>&1)
if [[ $last_erts != $curr_erts ]]
then
pushd "$ZOMP_DIR/lib" > /dev/null
find . -name "*.beam" -type f -delete
echo "$curr_erts" > "$last_file"
popd > /dev/null
fi
start_dir="$PWD"
cd "$ZX_DIR"
if [ ! -f ebin/zx.beam ]
then
then
chmod +x make_zx
./make_zx
./make_zx 1>&2
fi
cd "$start_dir"
erl -noshell -pa "$ZX_DIR/ebin" -run zx do -extra $@
+20 -3
View File
@@ -1,7 +1,7 @@
#! /bin/bash
if [ -f "$HOME/.bash_profile" ]
then
then
. "$HOME"/.bash_profile
fi
@@ -9,12 +9,29 @@ export ZOMP_DIR="${ZOMP_DIR:-$HOME/zomp}"
export ZX_VERSION=$(cat "$ZOMP_DIR/etc/version.txt")
export ZX_DIR="$ZOMP_DIR/lib/otpr/zx/$ZX_VERSION"
last_file="$ZOMP_DIR/last.erts"
if [[ -f "$last_file" ]]
then
last_erts=$(cat "$last_file")
else
last_erts="NONE"
fi
curr_erts=$(erl -version 2>&1)
if [[ $last_erts != $curr_erts ]]
then
pushd "$ZOMP_DIR/lib" > /dev/null
find . -name "*.beam" -type f -delete
echo "$curr_erts" > "$last_file"
popd > /dev/null
fi
start_dir="$PWD"
cd "$ZX_DIR"
if [ ! -f ebin/zx.beam ]
then
then
chmod +x make_zx
./make_zx
./make_zx 1>&2
fi
cd "$start_dir"
erl -pa "$ZX_DIR/ebin" -run zx do -extra $@