Skip to content

Commit

Permalink
refactor: small improvements to code
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMenoti committed May 28, 2024
1 parent 10626ff commit 951fc2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
11 changes: 2 additions & 9 deletions pkg/cmd/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ func (cmd *initCmd) Run(_ *cobra.Command, _ []string) error {
return msg.ErrorWorkingDir
}

shouldDev := cmd.shouldDevDeploy(msg.AskLocalDev, cmd.globalFlagAll, false)

if shouldDev {
if cmd.shouldDevDeploy(msg.AskLocalDev, cmd.globalFlagAll, false) {
if cmd.shouldDevDeploy(msg.AskInstallDepsDev, cmd.globalFlagAll, false) {
answer, err := utils.GetPackageManager()
if err != nil {
Expand All @@ -180,12 +178,7 @@ func (cmd *initCmd) Run(_ *cobra.Command, _ []string) error {
}

if cmd.shouldDevDeploy(msg.AskDeploy, cmd.globalFlagAll, false) {
shouldDeps := cmd.shouldDevDeploy(msg.AskInstallDepsDeploy, cmd.globalFlagAll, false)
if err != err {
return err
}

if shouldDeps {
if cmd.shouldDevDeploy(msg.AskInstallDepsDeploy, cmd.globalFlagAll, false) {
answer, err := utils.GetPackageManager()
if err != nil {
return err
Expand Down
8 changes: 2 additions & 6 deletions pkg/cmd/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ func (cmd *LinkCmd) run(info *LinkInfo) error {
logger.FInfo(cmd.Io.Out, msg.WebAppLinkCmdSuccess)

if !info.Auto {
shouldDev := cmd.ShouldDevDeploy(info, msg.AskLocalDev, false)

if shouldDev {
if cmd.ShouldDevDeploy(info, msg.AskLocalDev, false) {
if cmd.ShouldDevDeploy(info, msg.AskInstallDepsDev, false) {
answer, err := utils.GetPackageManager()
if err != nil {
Expand All @@ -220,9 +218,7 @@ func (cmd *LinkCmd) run(info *LinkInfo) error {
logger.FInfo(cmd.Io.Out, msg.LinkDevCommand)
}

shouldDeploy := cmd.ShouldDevDeploy(info, msg.AskDeploy, false)

if shouldDeploy {
if cmd.ShouldDevDeploy(info, msg.AskDeploy, false) {
if cmd.ShouldDevDeploy(info, msg.AskInstallDepsDeploy, false) {
answer, err := utils.GetPackageManager()
if err != nil {
Expand Down

0 comments on commit 951fc2f

Please sign in to comment.