Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing commands (import-db, export-db) when outside project, fixes #1872 #1917

Merged
merged 1 commit into from Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions cmd/ddev/cmd/export-db.go
@@ -1,7 +1,6 @@
package cmd

import (
"github.com/drud/ddev/pkg/nodeps"
"os"

"github.com/drud/ddev/pkg/ddevapp"
Expand Down Expand Up @@ -50,8 +49,5 @@ var ExportDBCmd = &cobra.Command{
func init() {
ExportDBCmd.Flags().StringVarP(&outFileName, "file", "f", "", "Provide the path to output the dump")
ExportDBCmd.Flags().BoolVarP(&gzipOption, "gzip", "z", true, "If provided asset is an archive, provide the path to extract within the archive.")
app, err := ddevapp.GetActiveApp("")
if err == nil && app != nil && !nodeps.ArrayContainsString(app.OmitContainers, "db") {
RootCmd.AddCommand(ExportDBCmd)
}
RootCmd.AddCommand(ExportDBCmd)
}
6 changes: 1 addition & 5 deletions cmd/ddev/cmd/import-db.go
@@ -1,7 +1,6 @@
package cmd

import (
"github.com/drud/ddev/pkg/nodeps"
"os"

"github.com/drud/ddev/pkg/ddevapp"
Expand Down Expand Up @@ -61,8 +60,5 @@ func init() {
ImportDBCmd.Flags().StringVarP(&dbSource, "src", "", "", "Provide the path to a sql dump in .sql or tar/tar.gz/tgz/zip format")
ImportDBCmd.Flags().StringVarP(&dbExtPath, "extract-path", "", "", "If provided asset is an archive, provide the path to extract within the archive.")
ImportDBCmd.Flags().BoolVarP(&progressOption, "progress", "p", true, "Display a progress bar during import")
app, err := ddevapp.GetActiveApp("")
if err == nil && app != nil && !nodeps.ArrayContainsString(app.OmitContainers, "db") {
RootCmd.AddCommand(ImportDBCmd)
}
RootCmd.AddCommand(ImportDBCmd)
}
7 changes: 1 addition & 6 deletions cmd/ddev/cmd/snapshot.go
@@ -1,8 +1,6 @@
package cmd

import (
"github.com/drud/ddev/pkg/ddevapp"
"github.com/drud/ddev/pkg/nodeps"
"github.com/drud/ddev/pkg/util"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -34,8 +32,5 @@ var DdevSnapshotCommand = &cobra.Command{
func init() {
DdevSnapshotCommand.Flags().BoolVarP(&snapshotAll, "all", "a", false, "Snapshot all running sites")
DdevSnapshotCommand.Flags().StringVarP(&snapshotName, "name", "n", "", "provide a name for the snapshot")
app, err := ddevapp.GetActiveApp("")
if err == nil && app != nil && !nodeps.ArrayContainsString(app.OmitContainers, "db") {
RootCmd.AddCommand(DdevSnapshotCommand)
}
RootCmd.AddCommand(DdevSnapshotCommand)
}