Created
January 23, 2014 21:34
-
-
Save wjessop/8587261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (r *repo_handle) get_tar_file() (string, error) { | |
target_dir, tmpdir_err := ioutil.TempDir("", "captain_app_tar") | |
log.Println("Got temp directory for app tar", target_dir) | |
if tmpdir_err != nil { | |
return "", tmpdir_err | |
} | |
archive_path := target_dir + "/" + "app.tar" | |
log.Println("Going to create the tar archive at path", archive_path) | |
log.Println("Creating app tar file:", tar_path, "--exclude", ".git", "-cf", archive_path, "-C", r.root, ".") | |
prepare_cmd := exec.Command(tar_path, "--exclude", ".git", "-cf", archive_path, "-C", r.root, ".") | |
prepare_err := prepare_cmd.Run() | |
if prepare_err != nil { | |
return "", prepare_err | |
} | |
return archive_path, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment