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:
+8
-1
@@ -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
|
||||
|
||||
@@ -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 $@
|
||||
|
||||
@@ -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 $@
|
||||
|
||||
Reference in New Issue
Block a user