Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

38 lignes
962 B

  1. %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
  2. %% ex: ts=4 sw=4 et
  3. %%
  4. %% @doc A localfs custom resource (for testing purposes only)
  5. %%
  6. %% ```
  7. %% {deps, [
  8. %% %% Application files are copied from "/path/to/app_name"
  9. %% {app_name, {localfs, "/path/to/app_name", undefined}}
  10. %% ]}.
  11. %% '''
  12. -module(rebar_localfs_resource).
  13. -behaviour(rebar_resource).
  14. -export([lock/2
  15. ,download/3
  16. ,needs_update/2
  17. ,make_vsn/1]).
  18. -include_lib("eunit/include/eunit.hrl").
  19. lock(AppDir, {localfs, Path, _Ref}) ->
  20. lock(AppDir, {localfs, Path});
  21. lock(_AppDir, {localfs, Path}) ->
  22. {localfs, Path, undefined}.
  23. needs_update(_AppDir, _Resource) ->
  24. false.
  25. download(AppDir, {localfs, Path, _Ref}, State) ->
  26. download(AppDir, {localfs, Path}, State);
  27. download(AppDir, {localfs, Path}, _State) ->
  28. ok = rebar_file_utils:cp_r(filelib:wildcard(Path ++ "/*"), AppDir),
  29. {ok, undefined}.
  30. make_vsn(_AppDir) ->
  31. {plain, "undefined"}.