File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 77 "time"
88
99 "github.com/pkg/browser"
10+ "github.com/urfave/cli"
11+
1012 "github.com/pluralsh/plural/pkg/api"
1113 "github.com/pluralsh/plural/pkg/config"
1214 "github.com/pluralsh/plural/pkg/crypto"
@@ -16,7 +18,6 @@ import (
1618 "github.com/pluralsh/plural/pkg/utils"
1719 "github.com/pluralsh/plural/pkg/utils/pathing"
1820 "github.com/pluralsh/plural/pkg/wkspace"
19- "github.com/urfave/cli"
2021)
2122
2223func handleInit (c * cli.Context ) error {
@@ -37,7 +38,6 @@ func handleInit(c *cli.Context) error {
3738 }
3839 defer func (prov provider.Provider ) {
3940 _ = prov .Flush ()
40-
4141 }(prov )
4242
4343 if ! git && affirm ("you're attempting to setup plural outside a git repository. would you like us to set one up for you here?" ) {
Original file line number Diff line number Diff line change @@ -23,7 +23,12 @@ func Preflight() (bool, error) {
2323
2424 cmd = exec .Command ("git" , "rev-parse" , "--abbrev-ref" , "HEAD" )
2525 if _ , err := cmd .CombinedOutput (); err != nil {
26- return false , utils .HighlightError (fmt .Errorf ("Repository has no initial commit, you can simply commit a blank readme and push to start working" ))
26+ return true , utils .HighlightError (fmt .Errorf ("repository has no initial commit, you can simply commit a blank readme and push to start working" ))
27+ }
28+
29+ cmd = exec .Command ("git" , "ls-remote" , "--exit-code" )
30+ if _ , err := cmd .CombinedOutput (); err != nil {
31+ return true , utils .HighlightError (fmt .Errorf ("repository has no remotes set, make sure that at least one remote is set" ))
2732 }
2833
2934 return true , nil
You can’t perform that action at this time.
0 commit comments