OpenWaterFoundation / owf-infomapper-poudre

Open Water Foundation data processing workflow for Poudre Basin dashboard
0 stars 2 forks source link

Copy script - use a "live watch" approach to copy files to InfoMapper #191

Closed smalers closed 2 years ago

smalers commented 2 years ago

I need to make it easier to create InfoMapper implementations, for example so that Josh can test full applications. Currently, a complication is that it is not easy or working to create a symbolic link on Windows in the owf-app-infomapper-ng asset files to an implementation's equivalent files, this did not work well.

Previously, the web/copy-to-infomapper.sh script was used to selectively copy files to the InfoMapper's assets folder after processing with the GeoProcessor. However, that requires an extra manual step and it is easy to forget.

Instead, I need to implement a "live watch" approach where when files created by the GeoProcessor are updated, they will automatically be copied to the InfoMapper's assets folder. I have done a similar thing with other tools. It is not too difficult and just requires that a script loop indefinitely, wait a few seconds between loops, list all files, check the modification times, and copy files that have a newer timestamp in the implementation repository. This can be coupled with a command file to process all products. Then Josh can run the copy script and regenerate the entire website, and files will be automatically copied to the InfoMapper's assets.

I am going to replace the current copy-to-infomapper.sh script with a new version that does the auto-copy.

smalers commented 2 years ago

I implemented the script and it seems to be working well. Close this issue.