Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
sort_releases(Root) ->
RelDir = filename:join([Root, "releases"]),
[ begin
RelFilename = filename:join([RelDir, Release]),
{ok, [{release, {Name, Version}, {erts, _}, _}]} = file:consult(RelFilename),
case filename:dirname(Release) =:= Version of
true ->
ignore;
false -> %% move
ok = filelib:ensure_dir(filename:join([RelDir, Version]) ++ "/"), %% make sure appropriate directory exists
RelFiles = filelib:wildcard(Name ++ ".*", filename:join([RelDir, filename:dirname(Release)])), %% release files
[ file:rename(filename:join([RelDir, filename:dirname(Release), RelFile]),
filename:join([RelDir, Version, RelFile])) || RelFile <- RelFiles ]
end
end || Release <- filelib:wildcard("*/*.rel", RelDir) ],
ok.
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.