Skip to content

Commit

Permalink
Fail immediately on mkdir error
Browse files Browse the repository at this point in the history
Tar was failing due to a missing destination directory on my laptop.
This makes it fail sooner.
  • Loading branch information
fhunleth authored and mobileoverlord committed Apr 26, 2019
1 parent fddde8e commit 3980125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nerves/artifact/cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ defmodule Nerves.Artifact.Cache do
File.rm_rf(dest)

if String.ends_with?(path, ext) do
File.mkdir_p(dest)
File.mkdir_p!(dest)
:ok = Nerves.Utils.File.untar(path, dest)
else
Path.dirname(dest)
|> File.mkdir_p()
|> File.mkdir_p!()

File.ln_s!(path, dest)
end
Expand Down

0 comments on commit 3980125

Please sign in to comment.