public
Last active

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

  • Download Gist
rebar.md
Markdown

Pre-requisites

  • 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://github.com/basho/rebar.git
cd rebar
bootstrap

hack rebar.cmd

  • open an editor capable of editing binary / hex without fudging line endings like http://textpad.com/
  • 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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.