Time to set up pre-commit hooks!

Cursor Prompt

can you help me set up pre commit hooks with husky @https://typicode.github.io/husky/ so that i can also run this script and build before i commit? I wouldnt wanna build on commit, but the rest of the stuff (optimize images, sync media, add tags) would be good to do automatically on commit

Am I lazy for vibe coding this hard? The way I see it, the less time I spend on these dev ops, the more time I have for actual creative processes.


Now, time optimize my media file names.


ls content/media
 
2023-11-21_1.webp       2024-08-03_1.webm
2023-11-21_2.webm       2024-08-03_2.webm
2023-11-27_1.webp       2024-08-04_1.webm
2023-11-27_2.webp       2024-08-04_2.webm
2023-11-30_1.webp       2024-08-04_3.webm
2023-11-30_2.webp       2024-08-09_1.webm
2023-11-30_3.webm       2024-08-09_2.webp
2023-12-01_1.webp       2024-08-10_1.webm
2023-12-01_2.webp       2024-08-10_10.webp
...

Well, that one was an adventure. Needless to say, I’m glad I made backups. All my files are renamed now though! Once the files got renamed, I had to open up my media backup folder in my GDrive and delete all the old files since the rClone sync-media script thought they were missing. I accidentally synced them back into my directory twice before I realized!

As a last optimization, I made it so any time I drag an image into Obsidian (which copies it into my root directory rather than /media), my optimization script automatically moves it to /media. Gonna run a build and see if this works!


It worked! Goodnight!


Tags: workflow programming scripting devops optimization rclone prompting