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

Generate only formatted files when using '--format' flag #136

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

mohammadhunan-dev
Copy link
Contributor

Improvement explanation:

This PR creates only the formatted files when running the snip command with a format specified.

Previously, in Bluehawk 1.3.1 if we run the following command:
bluehawk snip __tests__/ts/CRUD/delete-test.tsx -o outputfolder --format=rst

this will produce 2 files:

├── delete-test.snippet.crud-delete-object.tsx
└── delete-test.snippet.crud-delete-object.tsx.rst

With this PR, it produces only:

└── delete-test.snippet.crud-delete-object.tsx.rst

since the format specified is "rst" (i.e it should not produce the 'tsx' file.)

Passing Tests:

Screen Shot 2023-01-03 at 11 21 35 AM

@@ -236,7 +235,7 @@ export const snip = async (
stateVersionWrittenForPath[document.path] = true;
}

if (id !== undefined) {
if (id) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change?

@cbush cbush merged commit de5954f into main Jan 9, 2023
@cbush cbush deleted the generate-only-formatted-files branch January 9, 2023 19:03
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