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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Save output to file #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlirezaKhadem
Copy link

No description provided.

@AlirezaKhadem
Copy link
Author

related to this feature request: #27

}

if _, err := os.Stat(filepath.Join(fullPath, filename)); os.IsNotExist(err) {
file, err := os.Create(filepath.Join(fullPath, filename))
Copy link
Owner

Choose a reason for hiding this comment

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

I think it's better if we don't left any err unchecked.

@@ -43,3 +54,62 @@ func findAndShowResult(username, site string) {
os.Exit(1)
}
}

func writeOutput(m *model, outputPath string, filename string, printFound bool) error {
Copy link
Owner

Choose a reason for hiding this comment

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

Just a nitpicking, But I would prefer to have these file related functions in a separate file.

@TheYahya
Copy link
Owner

TheYahya commented Jan 5, 2024

Hey @AlirezaKhadem, Nice work. Thanks for the PR.

I would prefer to have the -o flag to be exactly name of the output file. Currently if I run enola theyahya -o output.txt it will generate a output.txt directory with a theyahya file inside it. I would prefer to just have output.txt file with the results.

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.

None yet

2 participants