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

Update init command format and add a helpful link #387

Merged
merged 9 commits into from
Jul 20, 2022

Conversation

janelletavares
Copy link
Contributor

@janelletavares janelletavares commented Jul 13, 2022

Description of change

Make init command conform to the standards of the other app commands.
Provide a helpful link when go mod init must be aborted.

Fixes https://github.com/meroxa/turbine-project/issues/202
Fixes https://github.com/meroxa/turbine-project/issues/212

Type of change

  • New feature
  • Bug fix
  • Refactor
  • Documentation

How was this tested?

  • Unit Tests
  • Tested in staging
  • Tested in minikube

Demo

BEFORE

Screenshot from 2022-07-13 14-40-11
Screenshot from 2022-07-13 14-39-49

AFTER

Screenshot from 2022-07-13 14-36-56
Screenshot from 2022-07-13 14-35-09

Additional references

Documentation updated

@janelletavares janelletavares marked this pull request as ready for review July 13, 2022 21:51
}

return os.Chdir(pwd)
}

func modulesInit(l log.Logger, appPath string, skipInit, vendor bool) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint complained... made me do it

Copy link
Contributor

@jayjayjpg jayjayjpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads great, thank you for the swift iteration on this! ✨

case "js", JavaScript, NodeJs:
err = turbinejs.Init(ctx, i.logger, name, i.path)
case "py", Python3, Python:
err = turbinepy.Init(ctx, i.logger, name, i.path)
default:
i.logger.StopSpinnerWithStatus("\t", log.Failed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition!

func GoInit(ctx context.Context, l log.Logger, appPath string, skipInit, vendor bool) error {
func GoInit(l log.Logger, appPath string, skipInit, vendor bool) error {
l.StartSpinner("\t", "Running golang module initializing...")
skipLog := "skipping go module initialization\n\tFor guidance, visit https://docs.meroxa.com/beta-overview#go-mod-init-for-a-new-golang-turbine-data-application"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads neat!

@@ -62,3 +65,7 @@ func (l *spinnerLogger) SuccessfulCheck() string {
func (l *spinnerLogger) FailedMark() string {
return color.New(color.FgRed).Sprintf("x")
}

func (l *spinnerLogger) WarningMark() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️

@janelletavares janelletavares merged commit 65661b7 into master Jul 20, 2022
@janelletavares janelletavares deleted the init-enhancements branch July 20, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants