cmoog / traderjoes

Price tracking program and website for Trader Joe's, updated daily.
https://traderjoesprices.com
MIT License
201 stars 15 forks source link

Verify site directory existence prior to deletion. #6

Closed ryanprince closed 7 months ago

ryanprince commented 7 months ago

This change improves developer experience.

Explanation: Since Git doesn't support empty directories, the site directory doesn't exist when the repository is newly cloned. Running the gen step without the site directory present produces the following error, at least for me on macOS, causing the gen step to fail.

traderjoes: site: removeDirectoryRecursive:getSymbolicLinkStatus: does not exist (No such file or directory)

Solution: There are multiple approaches to solving this, e.g. by using a .gitkeep file. This particular change works by attempting site directory deletion if and only if the site directory already exists.

cmoog commented 7 months ago

This looks great. Thanks for catching this and implementing a clean fix.