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

Accept module name as input to create command #298

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

Patel-Raj
Copy link
Contributor

@Patel-Raj Patel-Raj commented Aug 26, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Problem/Feature

go-blueprint create command was not working as expected if the user enters module name as an input rather than directory name.

Eg: go-blueprint create --name github.com/Patel-Raj/project1

This would create sub-directories github.com, Patel-Raj and project1 and then create the projects source code in project1 directory.

After this change, the Go project will be created at project1 as the root directory and the go.mod would have github.com/Patel-Raj/project1 as its module name.

Fixes: #285

Description of Changes:

  • Fetched directory name from the input string as the last token of the input when Split by /
  • Relaxed the sanitization regex to allow / and . characters in the input.
  • Used that the directory name to create the root directory.
  • Added unit tests for the newly added util functions.

Checklist

  • [Y] I have self-reviewed the changes being requested
  • [Y] I have updated the documentation (if applicable)

Copy link
Collaborator

@Ujstor Ujstor left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay, I didn't have time for proper testing. The PR is amazing, and it LGTM!!

@Ujstor Ujstor merged commit ae0e782 into Melkeydev:main Sep 15, 2024
159 checks passed
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.

[Feature Request] Add option to include slashes and dots in project name
2 participants