Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@dch /

build a stand-alone erlang rebar.cmd script with no dependencies


  • install MSYSGIT and add <gitdir>/bin/cmd to path
  • install Erlang/OTP minimum R15B02 (fixes escript swallowing stdout on exit, and adds line numbers to errors)
  • add Erlang/OTP to path

get fresh rebar

git clone git://
cd rebar

hack rebar.cmd

  • open an editor capable of editing binary / hex without fudging line endings like
  • remove the first line #!/usr/bin/env escript
  • replace with @echo off & setlocal & path=%~dp0;%path%; & escript.exe "%~dpn0.cmd" %* & goto :eof
  • save & you're done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.