[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/246/original/DALL%C2%B7E_2023-10-21_13.05.52_-_Illustration_in_a_soft_anime_style_showing_a_girl__inspired_by_Limor_Fried__sweeping_the_floor_of_a_library._She_has_pink_hair_and_is_dressed_in_a_tea.png?1697908009","metadata":{"caption":"DALL-E 3 Illustration in a soft anime style showing a girl, inspired by Limor Fried, sweeping the floor of a library. She has pink hair and is dressed in a teal blue and white dress covered in infinity symbols. The books on the shelves have teal and white spines, and the background is free of white specks."}},{"element_type":"text","content":"\n  \n  \n  \n        \u003cp\u003eI've got \u003cem\u003ehundreds\u003c/em\u003e of Arduino libraries that we maintain in my 'libraries' folder, and it can very quickly get difficult to maintain them. There's 4 issues I spent an inordinate amount of time on!\u003c/p\u003e\n\u003cp\u003eFirst issue is that whenever a library is updated, the IDE does not delete the previous version, but keeps both around...after a few years this ends in a lot of cruft. \u003c/p\u003e\n\u003cp\u003eSecondly, libraries downloaded via the IDE are placed into a folder in the format \u003cem\u003earduino_nnnnn\u003c/em\u003e where n is a number, so you don't really know what library is inside it, making the first issue hard to clean up\u003c/p\u003e\n\u003cp\u003eThirdly - for Adafruit libraries, they are \u003ccode\u003egit clone\u003c/code\u003e'd into the library folder which means I sometimes end up in a branch that I'm working on, and then submit a PR. Days later I've forgotten to change back into my \u003cstrong\u003emain\u003c/strong\u003e branch, losing out on any merged updates!\u003c/p\u003e\n\u003cp\u003eFinally - there's constant updates to our libraries, and the IDE does alert me when this happens - which means I need to do a git pull - but in hundreds of libraries this takes a long time to go to each folder and run the git pull command.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eTHUS\u003c/strong\u003e a script! This python code does a number of clean up tasks, I only have to run it a few times a week and it will keep my arduino libraries folder nice n tidy. \u003ca href=\"https://chat.openai.com/share/6ad93735-4ece-476f-9eca-ea5fcd51890a\"\u003eThanks to ChatGPT4 Sept 25 for the assist\u003c/a\u003e, it made the scripting faster (note I did make some changes beyond what GPT4 wrote)\u003c/p\u003e\n      \n\n\n","metadata":{}},{"element_type":"embed","content":"https://gist.github.com/ladyada/3b90fae2af3002a792f97256c4884ff3"}]