Generates the <app>.run shell script embedded in the release tarball.
The .run script is the entry point for the final binary (after the Rust
wrapper extracts the payload). It sets up the environment (PATH, BINDIR,
neutralizes asdf/mise) and execs the appropriate target:
escript format: execs
release/bin/<app>directly. The escript shebang (#!/usr/bin/env escript) finds the bundledescriptvia PATH, which findserlvia PATH, which findserlexecvia BINDIR. No ESCRIPT_EMULATOR needed on OTP ≤ 26.release format: execs
release/bin/<app>with the right subcommand:cli→eval 'Module.CLI.main()' -- "$@"daemon→daemon "$@"tui→start "$@"
This script is ~1KB and is GENERATED at build time by batamanta, not at runtime by the Rust wrapper. Changing env vars does NOT require recompiling the Rust dispenser.
Summary
Functions
Derives the CLI module name from the application name.
Generates the .run script content as a string.
Functions
Derives the CLI module name from the application name.
Examples
iex> Batamanta.RunScript.derive_cli_module("delfos")
"Delfos.CLI"
iex> Batamanta.RunScript.derive_cli_module("test_escript")
"TestEscript.CLI"
Generates the .run script content as a string.
Parameters
app_name- Application name (e.g.,"delfos","test_escript")exec_mode- Execution mode::cli,:daemon, or:tuiformat- Output format::escriptor:releaseerts_version- ERTS version string (e.g.,"14.2")opts- Optional overrides::cli_module- Custom CLI module (default:Macro.camelize(app_name) <> ".CLI")
Returns
String containing the run script (with trailing newline).