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

Added bsf clean Command to Remove Autogenerated Files #121

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RohanMishra315
Copy link

@RohanMishra315 RohanMishra315 commented Oct 12, 2024

#120

Description:

This PR introduces a new bsf clean command that simplifies the cleanup of autogenerated files and directories during development. This feature is especially useful when testing new features or iterating locally, where manual deletion of these files is often needed.

Key Features:

  1. New bsf clean Command:

The bsf clean command deletes the following autogenerated files and directories:
bsf/
bsf-result/
bsf.hcl
bsf.lock

  1. Reused Cleanup Logic:

Reuses the cleanup logic from cmd/init, ensuring consistency and reducing code duplication.

)

func init() {
rootCmd.AddCommand(cleanCmd)
Copy link
Member

Choose a reason for hiding this comment

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

This logic should go over here:

bsf/cmd/cmd.go

Line 70 in a2c73d1

if os.Getenv("BSF_DEBUG_MODE") == "true" {

cmd/clean/clean.go Outdated Show resolved Hide resolved

// cleanUp deletes the autogenerated BSF files and directories.
func cleanUp() error {
configs := []string{"bsf", "bsf-result", "bsf.hcl", "bsf.lock"}
Copy link
Member

Choose a reason for hiding this comment

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

Will this give an error if bsf-result is not already present? Please check once

Copy link
Member

Choose a reason for hiding this comment

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

Did you check this? Was it giving an error?

}

// cleanUp deletes the autogenerated BSF files and directories.
func cleanUp() error {
Copy link
Member

Choose a reason for hiding this comment

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

Please reuse the logic which is already present under cmd/init

cmd/clean/clean.go Outdated Show resolved Hide resolved
cmd/clean/clean.go Outdated Show resolved Hide resolved
Copy link
Member

@rakshitgondwal rakshitgondwal left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you please sign your commits?

@RohanMishra315
Copy link
Author

Thanks for the PR! Can you please sign your commits?

Done , pls check it and anything to add let me know

Copy link
Member

@rakshitgondwal rakshitgondwal left a comment

Choose a reason for hiding this comment

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

Done , pls check it and anything to add let me know

Thanks for making the changes @RohanMishra315. The commits are still not signed and some of the comments are still unaddressed, please fix those as well. Additionally, can you add yourself in the ./CONTRIBUTORS.md file as well?

@rakshitgondwal
Copy link
Member

Hi @RohanMishra315, let me know if you need any help

@rakshitgondwal
Copy link
Member

Hi @RohanMishra315, checking up on this again

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