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: don't create license file when initializing private orb #962

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
13 changes: 11 additions & 2 deletions cmd/orb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,8 @@ func initOrb(opts orbOptions) error {
defer resp.Body.Close()

// Create the file
out, err := os.Create(filepath.Join(os.TempDir(), "orb-template.zip"))
zipPath := filepath.Join(os.TempDir(), "orb-template.zip")
out, err := os.Create(zipPath)
if err != nil {
return err
}
Expand All @@ -1230,11 +1231,19 @@ func initOrb(opts orbOptions) error {
return err
}

err = unzipToOrbPath(filepath.Join(os.TempDir(), "orb-template.zip"), orbPath)
err = unzipToOrbPath(zipPath, orbPath)
if err != nil {
return err
}

// Remove MIT License file if orb is private
if opts.private {
err = os.Remove(filepath.Join(orbPath, "LICENSE"))
if err != nil && !errors.Is(err, os.ErrNotExist) {
return err
}
}

if fullyAutomated == 1 {
fmt.Println("Opted for manual setup, exiting")
fmt.Printf("The Orb Project Template has been extracted to %s\n", orbPath)
Expand Down