Create a gist now

Instantly share code, notes, and snippets.

reltool doesn't like non-numeric version numbers in directory names
%% -*- erlang -*-
{application, foo_app,
[
%% This application has a non-numeric version number.
{vsn, "abc"}]}.
%% -*- erlang -*-
{sub_dirs, ["foo_app", "bar_rel"]}.
%% -*- erlang -*-
{sys,
[
{lib_dirs, ["../apps"]},
{rel, "bar_rel", "1", [foo_app]},
{rel, "start_clean", "1", [kernel, stdlib]}]}.
#!/bin/sh
mysubdir=$1
if [ -z "$mysubdir" ]; then
echo "Usage: $0 subdirname"
echo ""
echo "subdirname is the directory name that the foo_app application will"
echo "be symlinked to in the apps/ directory. My observation is that"
echo "reltool accepts 'foo_app' and 'foo_app-1', but rejects 'foo_app-abc',"
echo "while starting an application works for all three names."
exit 1
fi
echo Compiling foo_app
rebar compile
echo Creating/cleaning apps
rm -rf apps
mkdir apps
echo Symlinking foo_app into apps/$mysubdir
ln -sf $PWD/foo_app apps/$mysubdir
echo Try starting the application
env ERL_LIBS=$PWD/apps erl -noshell -eval 'io:format("application:start(foo_app) -> ~p~n", [application:start(foo_app)])' -s init stop
echo Try building the release
rebar generate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment