Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Minor improvements to readme and godoc; new build script
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jun 6, 2016
1 parent bbda37c commit 5374408
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
_gitignore
builds/
52 changes: 29 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,40 @@ Package archiver makes it trivially easy to make and extract .zip and .tar.gz fi

Files are put into the root of the archive; directories are recursively added.

The `archiver` command runs the same cross-platform and has no external dependencies (not even libc); powered by the Go standard library. Enjoy.


## Install

```bash
go get github.com/mholt/archiver
```

Or download from the [releases](https://github.com/mholt/archiver/releases) page.


## Command Use

Make a new archive:

```bash
$ archiver make [archive name] [input files...]
```

(At least one input file is required.)

To extract an archive:

```bash
$ archiver open [archive name] [destination]
```

(The destination path is optional; default is current directory.)

The archive name must end with a supported file extension like .zip or .tar.gz—this is how it knows what kind of archive to make.




## Library Use

Expand Down Expand Up @@ -40,35 +67,14 @@ err := archiver.UntarGz("input.tar.gz", "output_folder")
```


## Command Use

Make a new archive:

```bash
$ archiver make [archive name] [input files...]
```

(At least one input file is required.)

To extract an archive:

```bash
$ archiver open [archive name] [destination]
```

(The destination path is optional; default is current directory.)

The archive name must end with a supported file extension like .zip or .tar.gz—this is how it knows what kind of archive to make.



## FAQ

#### Can I list a file to go in a different folder in the archive?

No, because I didn't need it to do that. Just structure your source files to mirror the structure in the archive, like you would normally do when you make an archive using your OS.
No. Just structure your input files to mirror the structure you want in the archive, like you would normally do when you make an archive using your OS.


#### Can it add files to an existing archive?

Nope. It just makes new archives or extracts existing ones.
Nope. It's a simple tool; it just makes new archives or extracts existing ones.
21 changes: 21 additions & 0 deletions build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -ex

# This script builds archiver for most common platforms.

export CGO_ENABLED=0

cd archiver
GOOS=linux GOARCH=386 go build -o ../builds/archiver_linux_386
GOOS=linux GOARCH=amd64 go build -o ../builds/archiver_linux_amd64
GOOS=linux GOARCH=arm go build -o ../builds/archiver_linux_arm7
GOOS=linux GOARCH=arm64 go build -o ../builds/archiver_linux_arm64
GOOS=darwin GOARCH=amd64 go build -o ../builds/archiver_mac_amd64
GOOS=windows GOARCH=386 go build -o ../builds/archiver_windows_386.exe
GOOS=windows GOARCH=amd64 go build -o ../builds/archiver_windows_amd64.exe
GOOS=freebsd GOARCH=386 go build -o ../builds/archiver_freebsd_386
GOOS=freebsd GOARCH=amd64 go build -o ../builds/archiver_freebsd_amd64
GOOS=freebsd GOARCH=arm go build -o ../builds/archiver_freebsd_arm7
GOOS=openbsd GOARCH=386 go build -o ../builds/archiver_openbsd_386
GOOS=openbsd GOARCH=amd64 go build -o ../builds/archiver_openbsd_amd64
cd ..
3 changes: 2 additions & 1 deletion zip.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Package archiver makes it super easy to create .zip and .tar.gz archives.
// Package archiver makes it super easy to create and open .zip and
// .tar.gz files.
package archiver

import (
Expand Down

0 comments on commit 5374408

Please sign in to comment.