Merge pull request '[BRANDING] forgejo dump cli file names and messages' (#494) from redwerkz/forgejo:forgejo-branding into forgejo-branding
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/494
This commit is contained in:
commit
dfe423fa6e
1 changed files with 7 additions and 7 deletions
14
cmd/dump.go
14
cmd/dump.go
|
@ -98,14 +98,14 @@ var outputTypeEnum = &outputType{
|
||||||
// CmdDump represents the available dump sub-command.
|
// CmdDump represents the available dump sub-command.
|
||||||
var CmdDump = cli.Command{
|
var CmdDump = cli.Command{
|
||||||
Name: "dump",
|
Name: "dump",
|
||||||
Usage: "Dump Gitea files and database",
|
Usage: "Dump Forgejo files and database",
|
||||||
Description: `Dump compresses all related files and database into zip file.
|
Description: `Dump compresses all related files and database into zip file.
|
||||||
It can be used for backup and capture Gitea server image to send to maintainer`,
|
It can be used for backup and capture Forgejo server image to send to maintainer`,
|
||||||
Action: runDump,
|
Action: runDump,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "file, f",
|
Name: "file, f",
|
||||||
Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
|
Value: fmt.Sprintf("forgejo-dump-%d.zip", time.Now().Unix()),
|
||||||
Usage: "Name of the dump file which will be created. Supply '-' for stdout. See type for available types.",
|
Usage: "Name of the dump file which will be created. Supply '-' for stdout. See type for available types.",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
|
@ -194,7 +194,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
if !setting.InstallLock {
|
if !setting.InstallLock {
|
||||||
log.Error("Is '%s' really the right config path?\n", setting.CustomConf)
|
log.Error("Is '%s' really the right config path?\n", setting.CustomConf)
|
||||||
return fmt.Errorf("gitea is not initialized")
|
return fmt.Errorf("forgejo is not initialized")
|
||||||
}
|
}
|
||||||
setting.LoadSettings() // cannot access session settings otherwise
|
setting.LoadSettings() // cannot access session settings otherwise
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
fatal("Path does not exist: %s", tmpDir)
|
fatal("Path does not exist: %s", tmpDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
dbDump, err := os.CreateTemp(tmpDir, "gitea-db.sql")
|
dbDump, err := os.CreateTemp(tmpDir, "forgejo-db.sql")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatal("Failed to create tmp file: %v", err)
|
fatal("Failed to create tmp file: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -289,8 +289,8 @@ func runDump(ctx *cli.Context) error {
|
||||||
fatal("Failed to dump database: %v", err)
|
fatal("Failed to dump database: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := addFile(w, "gitea-db.sql", dbDump.Name(), verbose); err != nil {
|
if err := addFile(w, "forgejo-db.sql", dbDump.Name(), verbose); err != nil {
|
||||||
fatal("Failed to include gitea-db.sql: %v", err)
|
fatal("Failed to include forgejo-db.sql: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(setting.CustomConf) > 0 {
|
if len(setting.CustomConf) > 0 {
|
||||||
|
|
Loading…
Reference in a new issue