Skip to content

Commit

Permalink
Remove project field from remotes configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Jul 9, 2018
1 parent 8555bd6 commit 924c36c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func NewConfigFromFiles(projectConfigPath string, remoteConfigPath string) (*Con
}

var (
project *InertiaProject
remotes *InertiaRemotes
project = &InertiaProject{}
remotes = &InertiaRemotes{}
)

// If both files are present, construct config using both
Expand Down Expand Up @@ -88,7 +88,6 @@ func NewConfigFromFiles(projectConfigPath string, remoteConfigPath string) (*Con
return nil, fmt.Errorf("remotes config error: %s", err.Error())
}
return NewConfigFromTOML(InertiaProject{
Project: remotes.Project,
Version: remotes.Version,
}, *remotes)
}
Expand All @@ -111,9 +110,6 @@ func NewConfigFromTOML(project InertiaProject, remotes InertiaRemotes) (*Config,
if *project.Version != *remotes.Version {
return nil, fmt.Errorf("mismatching versions %s and %s", *project.Version, *remotes.Version)
}
if *project.Project != *project.Project {
return nil, fmt.Errorf("mismatching projects %s and %s", *project.Project, *remotes.Project)
}

// Generate configuration
return &Config{
Expand Down Expand Up @@ -183,7 +179,7 @@ func (config *Config) WriteProjectConfig(filePath string, writers ...io.Writer)
// WriteRemoteConfig writes Inertia remote configuration. This file should NOT
// be committed.
func (config *Config) WriteRemoteConfig(filePath string, writers ...io.Writer) error {
toml := InertiaRemotes{&config.Version, &config.Project, &config.remotes}
toml := InertiaRemotes{&config.Version, &config.remotes}
return config.write(filePath, toml, writers...)
}

Expand Down
1 change: 0 additions & 1 deletion cfg/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type InertiaProject struct {
// configuration for this project. This file should NOT be committed.
type InertiaRemotes struct {
Version *string `toml:"version"`
Project *string `toml:"project-name"`
Remotes *map[string]*RemoteVPS `toml:"remotes"`
}

Expand Down

0 comments on commit 924c36c

Please sign in to comment.