Skip to content

Commit

Permalink
.functions: Tweak targz
Browse files Browse the repository at this point in the history
Trim the trailing slash from the path argument passed to `targz`.

This fixes the annoying behavior where `targz foo/` created `foo/.tar.gz` instead of `foo.tar.gz`.

Ref. mathiasbynens#202.
  • Loading branch information
0xcc77 authored and mathiasbynens committed May 8, 2013
1 parent c546391 commit a43f474
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .functions
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function cdf() { # short for `cdfinder`

# Create a .tar.gz archive, using `zopfli`, `pigz` or `gzip` for compression
function targz() {
local tmpFile="${@}.tar"
local tmpFile="${@%/}.tar"
tar -cvf "${tmpFile}" --exclude=".DS_Store" "${@}" || return 1

size=$(
Expand Down

0 comments on commit a43f474

Please sign in to comment.