diff options
Diffstat (limited to 'src/rebar_packages.erl')
-rw-r--r-- | src/rebar_packages.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rebar_packages.erl b/src/rebar_packages.erl index 50d4025..8cebeca 100644 --- a/src/rebar_packages.erl +++ b/src/rebar_packages.erl @@ -97,7 +97,12 @@ registry_dir(State) -> case rebar_state:get(State, rebar_packages_cdn, ?DEFAULT_CDN) of ?DEFAULT_CDN -> RegistryDir = filename:join([CacheDir, "hex", "default"]), - ok = filelib:ensure_dir(filename:join(RegistryDir, "placeholder")), + case filelib:ensure_dir(filename:join(RegistryDir, "placeholder")) of + ok -> ok; + {error, Posix} when Posix == eaccess; Posix == enoent -> + ?ABORT("Could not write to ~p. Please ensure the path is writeable.", + [RegistryDir]) + end, {ok, RegistryDir}; CDN -> case rebar_utils:url_append_path(CDN, ?REMOTE_PACKAGE_DIR) of |