Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a cheat sheet to the docs #370

Open
nyaray opened this issue Sep 24, 2015 · 0 comments
Open

Adding a cheat sheet to the docs #370

nyaray opened this issue Sep 24, 2015 · 0 comments

Comments

@nyaray
Copy link

nyaray commented Sep 24, 2015

It would be immensely helpful to have a cheat sheet with useful (and sometimes rarely executed) commands. I'm thinking something along the lines of the following, but don't really know where it could/should/would go, so I'm just filing this here.

erlang.mk Cheat Sheet (starting point)

This document provides some useful (and maybe less commonly executed) commands.

"How Do I"...

Issue Command
See all available targets make help
Update erlang.mk make erlang-mk
Build a project make
Fetch and build dependencies make deps
[TO BE DECIDED] Update the dependencies make ...
Test things manually make shell
Run a release make run
List packages make search
Search across all packages make search q=json
List available templates make list-templates
Generate a gen_server module make new t=gen_server n=my_server

Configuration

Adding dependencies is done by adding package names to the DEPS variable in Makefile before the include erlang.mk line. List or search in the packages as described above to find something you might need. An example Makefile:

PROJECT = "my_project"
DEPS = cowboy
include erlang.mk

Getting started

Open a shell, cd into an empty directory and paste the following commands:

URL="https://raw.githubusercontent.com/ninenines/erlang.mk/master/erlang.mk";\
if [ -n $(command -v wget) ]; then; wget $URL; else; curl $URL; fi;\
make -f erlang.mk;

Done!

Bootstrapping

OTP Pattern Command
Application make -f erlang.mk bootstrap
Library make -f erlang.mk bootstrap-lib
Release make bootstrap-rel (can be appended to any of the previous targets)

Bootstrap for the kind of project you want to create. If you want to build a release containing an application or a library you can combine either target with bootstrap-rel. Bootstrapping a release running an OTP application:

make -f erlang.mk bootstrap bootstrap-rel

NOTE: When you've used bootstrap-rel make will cause the release to be built.

Run the built release:

make run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants