SHARE
TWEET

Untitled

a guest Aug 13th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* nom-order, part of the nom suite
  2.    for more info see nom.ccallahan.info.
  3.    Version 0.1 */
  4. package main
  5.  
  6. import (
  7.     "archive/tar"
  8.     "io"
  9.     "os"
  10.     "log"
  11. )
  12.  
  13. func var() (
  14.     NOMHOME = os.Getenv("NOMHOME")
  15.     )
  16.  
  17. func init() {
  18.     if NOMHOME == "" {
  19.         log.Fatal("Yes, We can tell you never read the INSTALL guide.")
  20.     }
  21.     if PACKAGE == "" {
  22.         log.Fatal("You need to specify that special package though the --package flag.")
  23.     }
  24.     flag.StringVar(&PACKAGE, "package", PACKAGE, "Package to deploy")
  25. }
  26.  
  27. func main() {
  28.     f, _ := os.Open(filepath.Join("PACKAGE.tar"))
  29.     defer f.Close()
  30.     untarred, _ := os.Create(filepath.Join(WATERHOME,PACKAGE))
  31.     defer untarred.Close()
  32.     tarReader := tar.NewReader(f)
  33.     io.Copy(untarred, tarReader)
  34. }
RAW Paste Data
Top