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 panic when dealing with empty manifest. #274

Merged
merged 1 commit into from
May 11, 2021
Merged
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
5 changes: 2 additions & 3 deletions pkg/compute/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (c *InitCommand) Exec(in io.Reader, out io.Writer) (err error) {
}
}

m, err := updateManifest(progress, c.path, name, desc, authors, language)
m, err := updateManifest(c.manifest.File, progress, c.path, name, desc, authors, language)
if err != nil {
return err
}
Expand Down Expand Up @@ -415,12 +415,11 @@ func pkgFetch(from string, branch string, tag string, fpath string, progress tex

// updateManifest updates the manifest with data acquired from various sources.
// e.g. prompting the user, existing manifest file.
func updateManifest(progress text.Progress, path string, name string, desc string, authors []string, lang *Language) (manifest.File, error) {
func updateManifest(m manifest.File, progress text.Progress, path string, name string, desc string, authors []string, lang *Language) (manifest.File, error) {
progress.Step("Updating package manifest...")

mp := filepath.Join(path, ManifestFilename)

var m manifest.File
if err := m.Read(mp); err != nil {
return m, fmt.Errorf("error reading package manifest: %w", err)
}
Expand Down