rebar does support this option. Does Rebar 3 not support it? What’s a better alternative, I work on windows and linux
if you are meaning clean compile file, I always rm -rf
I want to use rebar3 clean -a to clean up the project
I’m not 100% sure if this is the equivalent but I use post hooks on clean
to clean extra files. These support custom commands for different targets. For example:
{post_hooks, [
{"(linux|darwin|solaris)", clean, "rm ./my_file"},
{"(linux|darwin|solaris)", clean, "make -C c_src/ clean"},
]}.
What is rebar3 clean -a
not doing, that you think it should be doing?
rebar
can specify a clean list like {clean_files, ["*.dump", "rebar.lock", "log/*"]}.
in rebar.config
to clear the files or folders when the rebar clean
command is executed
I don’t want to write Windows and linxu delete commands in the rebar.config
To avoid Windows / Linux specific code you could add your own ‘generic’ code in the rebar.config.script
that calls out to the erlang file
module that references your clean_files
configuration. Like:
FilesToClean = lists:keyfind(clean_files, 1, CONFIG),
[file:delete(File) || File <- FilesToClean].
Might need add some logic to call out to filelib
to get wild cards working though.
Thank you for both solutions