Skip to content

Instantly share code, notes, and snippets.

View sdomino's full-sized avatar

Steve Domino sdomino

View GitHub Profile
package main
import (
"fmt"
"github.com/go-fsnotify/fsnotify"
)
// main
func main() {
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/go-fsnotify/fsnotify"
)
package main
import (
"archive/tar"
"compress/gzip"
"crypto/md5"
"fmt"
"io"
"os"
"path/filepath"
// Untar takes a destination path and a reader; a tar reader loops over the tarfile
// creating the file structure at 'dst' along the way, and writing any files
func Untar(dst string, r io.Reader) error {
gzr, err := gzip.NewReader(r)
if err != nil {
return err
}
defer gzr.Close()
// Tar takes a source and variable writers and walks 'source' writing each file
// found to the tar writer; the purpose for accepting multiple writers is to allow
// for multiple outputs (for example a file, or md5 hash)
func Tar(src string, writers ...io.Writer) error {
// ensure the src actually exists before trying to tar it
if _, err := os.Stat(src); err != nil {
return fmt.Errorf("Unable to tar files - %v", err.Error())
}
package main
import (
"encoding/json"
"fmt"
"github.com/nanobox-io/golang-scribble"
)
// a fish
type Fish struct{ Name string }
package commands
import (
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/cobra"
"github.com/spf13/viper"
package main
import (
"fmt"
"os"
"github.com/nanopack/hoarder/commands"
)
//
package commands
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
# boxfile.yml
run.config:
engine: ruby
# add extra packages
extra_packages:
- nodejs
- nginx
#