Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clienv/clienv.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func FromCLI(cCtx *cli.Context) *CliEnv {
cwd,
cCtx.String(flagRootFolder),
cCtx.String(flagDotNhostFolder),
cCtx.String(flagDataFolder),
cCtx.String(flagNhostFolder),
),
authURL: cCtx.String(flagAuthURL),
Expand Down
8 changes: 1 addition & 7 deletions clienv/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ type PathStructure struct {
workingDir string
root string
dotNhostFolder string
dataFolder string
nhostFolder string
}

func NewPathStructure(
workingDir, root, dotNhostFolder, dataFolder, nhostFolder string,
workingDir, root, dotNhostFolder, nhostFolder string,
) *PathStructure {
return &PathStructure{
workingDir: workingDir,
root: root,
dotNhostFolder: dotNhostFolder,
dataFolder: dataFolder,
nhostFolder: nhostFolder,
}
}
Expand All @@ -37,10 +35,6 @@ func (p PathStructure) DotNhostFolder() string {
return p.dotNhostFolder
}

func (p PathStructure) DataFolder() string {
return p.dataFolder
}

func (p PathStructure) NhostFolder() string {
return p.nhostFolder
}
Expand Down
15 changes: 3 additions & 12 deletions clienv/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const (
flagBranch = "branch"
flagProjectName = "project-name"
flagRootFolder = "root-folder"
flagDataFolder = "data-folder"
flagNhostFolder = "nhost-folder"
flagDotNhostFolder = "dot-nhost-folder"
flagLocalSubdomain = "local-subdomain"
Expand All @@ -38,7 +37,7 @@ func getGitBranchName() string {
return head.Name().Short()
}

func Flags() ([]cli.Flag, error) { //nolint:funlen
func Flags() ([]cli.Flag, error) {
fullWorkingDir, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("failed to get working directory: %w", err)
Expand All @@ -48,7 +47,6 @@ func Flags() ([]cli.Flag, error) { //nolint:funlen

workingDir := "."
dotNhostFolder := filepath.Join(workingDir, ".nhost")
dataFolder := filepath.Join(dotNhostFolder, "data", branch)
nhostFolder := filepath.Join(workingDir, "nhost")

return []cli.Flag{
Expand All @@ -68,10 +66,10 @@ func Flags() ([]cli.Flag, error) { //nolint:funlen
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagBranch,
Usage: "Git branch name",
Usage: "Git branch name. If not set, it will be detected from the current git repository. This flag is used to dynamically create docker volumes for each branch. If you want to have a static volume name or if you are not using git, set this flag to a static value.", //nolint:lll
EnvVars: []string{"BRANCH"},
Value: branch,
Hidden: true,
Hidden: false,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagRootFolder,
Expand All @@ -87,13 +85,6 @@ func Flags() ([]cli.Flag, error) { //nolint:funlen
Value: dotNhostFolder,
Category: "Project structure",
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagDataFolder,
Usage: "Data folder to persist data\n\t",
EnvVars: []string{"NHOST_DATA_FOLDER"},
Value: dataFolder,
Category: "Project structure",
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagNhostFolder,
Usage: "Path to nhost folder\n\t",
Expand Down
1 change: 0 additions & 1 deletion cmd/config/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ func TestValidate(t *testing.T) {
".",
filepath.Join("testdata", "validate", tc.path),
filepath.Join("testdata", "validate", tc.path, ".nhost"),
filepath.Join("testdata", "validate", tc.path, ".nhost", "data"),
filepath.Join("testdata", "validate", tc.path, "nhost"),
),
"fakeauthurl",
Expand Down
1 change: 0 additions & 1 deletion cmd/dev/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ func up( //nolint:funlen,cyclop
httpPort,
useTLS,
postgresPort,
ce.Path.DataFolder(),
ce.Path.NhostFolder(),
ce.Path.DotNhostFolder(),
ce.Path.Root(),
Expand Down
4 changes: 1 addition & 3 deletions dockercompose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ func getServices( //nolint: funlen,cyclop
httpPort uint,
useTLS bool,
postgresPort uint,
dataFolder string,
nhostFolder string,
dotNhostFolder string,
rootFolder string,
Expand All @@ -535,6 +534,7 @@ func getServices( //nolint: funlen,cyclop
}

pgVolumeName := "pgdata_" + sanitizeBranch(branch)
dataFolder := filepath.Join(dotNhostFolder, "data")
postgres, err := postgres(cfg, subdomain, postgresPort, dataFolder, pgVolumeName)
if err != nil {
return nil, err
Expand Down Expand Up @@ -636,7 +636,6 @@ func ComposeFileFromConfig( //nolint:funlen
httpPort uint,
useTLS bool,
postgresPort uint,
dataFolder string,
nhostFolder string,
dotNhostFolder string,
rootFolder string,
Expand All @@ -655,7 +654,6 @@ func ComposeFileFromConfig( //nolint:funlen
httpPort,
useTLS,
postgresPort,
dataFolder,
nhostFolder,
dotNhostFolder,
rootFolder,
Expand Down
Loading