Skip to content

Commit

Permalink
fix: don't create license file when initializing private orb (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
loderunner authored Jul 10, 2023
1 parent 49bfd46 commit 62f7bd3
Showing 1 changed file with 11 additions and 2 deletions.
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

0 comments on commit 62f7bd3

Please sign in to comment.