summaryrefslogtreecommitdiffstats
path: root/cmd/dump.go
diff options
context:
space:
mode:
authorMorgan Bazalgette <git@howl.moe>2018-01-12 23:16:49 +0100
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-12 23:16:49 +0100
commit2b52f77e1b288a1d6dec95339ef58241d0de21ed (patch)
treef2af25fbc86068f20322d3c420ab26c70de9e9ef /cmd/dump.go
parent079273e2ffceb615213409adcce6b9366de6ee41 (diff)
downloadgitea-2b52f77e1b288a1d6dec95339ef58241d0de21ed.tar.gz
gitea-2b52f77e1b288a1d6dec95339ef58241d0de21ed.zip
General refactor of the cmd package (#3328)
* General refactor of the cmd package * Address breakage in runCreateUser * Place "common" functions into cmd.go
Diffstat (limited to 'cmd/dump.go')
-rw-r--r--cmd/dump.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/dump.go b/cmd/dump.go
index 588a2175de..bbefda63ee 100644
--- a/cmd/dump.go
+++ b/cmd/dump.go
@@ -68,19 +68,19 @@ func runDump(ctx *cli.Context) error {
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
log.Fatalf("Path does not exist: %s", tmpDir)
}
- TmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
+ tmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
if err != nil {
log.Fatalf("Failed to create tmp work directory: %v", err)
}
- log.Printf("Creating tmp work dir: %s", TmpWorkDir)
+ log.Printf("Creating tmp work dir: %s", tmpWorkDir)
// work-around #1103
if os.Getenv("TMPDIR") == "" {
- os.Setenv("TMPDIR", TmpWorkDir)
+ os.Setenv("TMPDIR", tmpWorkDir)
}
- reposDump := path.Join(TmpWorkDir, "gitea-repo.zip")
- dbDump := path.Join(TmpWorkDir, "gitea-db.sql")
+ reposDump := path.Join(tmpWorkDir, "gitea-repo.zip")
+ dbDump := path.Join(tmpWorkDir, "gitea-db.sql")
log.Printf("Dumping local repositories...%s", setting.RepoRootPath)
zip.Verbose = ctx.Bool("verbose")
@@ -146,10 +146,10 @@ func runDump(ctx *cli.Context) error {
log.Printf("Can't change file access permissions mask to 0600: %v", err)
}
- log.Printf("Removing tmp work dir: %s", TmpWorkDir)
+ log.Printf("Removing tmp work dir: %s", tmpWorkDir)
- if err := os.RemoveAll(TmpWorkDir); err != nil {
- log.Fatalf("Failed to remove %s: %v", TmpWorkDir, err)
+ if err := os.RemoveAll(tmpWorkDir); err != nil {
+ log.Fatalf("Failed to remove %s: %v", tmpWorkDir, err)
}
log.Printf("Finish dumping in file %s", fileName)