Skip to content

Clean output directory #155

Description

@dmurvihill

I changed the name of one of my input files, and now the previous output file with the old name is still sitting around and getting stale. I worry that if I also forget to update file name in my documentation templates, my docs simply will stop updating with the code and the reason will not be obvious.

Could I have a flag that, in addition to saving all files to the output directory, also lists the output directory and removes any that don't have a match?

Thanks! Love this tool.

dolan@Dolans-MacBook-Pro 20250723_stop_throwing_errors % ls -a build/                
.	..
dolan@Dolans-MacBook-Pro 20250723_stop_throwing_errors % npx bluehawk snip -o build tests
parsed file: /Users/dolan/writing/20250723_stop_throwing_errors/tests/test_samples.ts
parsed file: /Users/dolan/writing/20250723_stop_throwing_errors/tests/test_test.ts
parsed file: /Users/dolan/writing/20250723_stop_throwing_errors/tests/mylog
wrote text file based on /Users/dolan/writing/20250723_stop_throwing_errors/tests/test_samples.snippet.test-snippet.ts -> build/test_samples.snippet.test-snippet.ts
Processed 3 files:
- 0 binary files
- 3 text files
- 0 errors
- 1 files written
dolan@Dolans-MacBook-Pro 20250723_stop_throwing_errors % ls build 
test_samples.snippet.test-snippet.ts
dolan@Dolans-MacBook-Pro 20250723_stop_throwing_errors % mv tests/test_samples.ts tests/test_bluehawk.ts
dolan@Dolans-MacBook-Pro 20250723_stop_throwing_errors % npx bluehawk snip -o build tests               
parsed file: /Users/dolan/writing/20250723_stop_throwing_errors/tests/test_bluehawk.ts
parsed file: /Users/dolan/writing/20250723_stop_throwing_errors/tests/test_test.ts
parsed file: /Users/dolan/writing/20250723_stop_throwing_errors/tests/mylog
wrote text file based on /Users/dolan/writing/20250723_stop_throwing_errors/tests/test_bluehawk.snippet.test-snippet.ts -> build/test_bluehawk.snippet.test-snippet.ts
Processed 3 files:
- 0 binary files
- 3 text files
- 0 errors
- 1 files written
dolan@Dolans-MacBook-Pro 20250723_stop_throwing_errors % ls build 
test_bluehawk.snippet.test-snippet.ts	test_samples.snippet.test-snippet.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions