Skip to content

Commit

Permalink
make output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
frantjc committed Oct 16, 2023
1 parent a4b1a9b commit 6831163
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GO = go
GIT = git
GOLANGCI-LINT = golangci-lint

SEMVER ?= 1.0.0
SEMVER ?= 1.0.1

fmt generate test:
@$(GO) $@ ./...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FROM scratch
COPY --from=ghcr.io/frantjc/dockerfile-addendum /addendum /usr/local/bin
ARG tgz=zip_3.0_x86_64.tgz
ADD ${tgz} /tmp
RUN addendum -ru /usr/local/bin /tmp/$(basename ${tgz})
RUN addendum -ruo /usr/local/bin /tmp/$(basename ${tgz})
```

Now this Dockerfile can be built with `--build-arg tgz=<src>` where `<src>` is either a tar archive at a remote URL or a local tar archive.
4 changes: 4 additions & 0 deletions command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func New() *cobra.Command {
output = filepath.Dir(path)
}

if err = os.MkdirAll(output, 0o666); err != nil {
return err
}

var r io.Reader
if compressed {
if r, err = gzip.NewReader(f); err != nil {
Expand Down

0 comments on commit 6831163

Please sign in to comment.