"Download ZIP file" issue, repos being renamed

Suppose I have a repository named MyLibrary on GitHub, and “main” is its default (and only) branch. If I click “Clone” then “Download ZIP file”, I get a ZIP file named “MyLibrary-main.zip”. Opening it up, I see my repository as a folder renamed to “MyLibrary-main”. This is a problem with Arduino code, because the Arduino IDE now allows libraries to be installed directly from ZIP files. Unfortunately, I end up with an installed library named “MyLibrary-main”, not “MyLibrary” as it was named in the repo. Since “-main” is already stated in the ZIP file’s name, isn’t it redundant to also name the contained folder the same way?

Is there a way to change my settings to turn off the renaming of the repo’s top folder when putting it in the ZIP file to be downloaded? If there isn’t a way, I recommend a change to GitHub to give us the option of turning off the renaming of a repo’s top folder before writing it to a ZIP file.

Thomas W Rackers

1 Like

Same here. Can’t find an answer and if this doesn’t have an override setting, we need to fight for one. It is the same issue with any Arduino project. The folder name must be identical to the .INO (main .cpp file) name. The ugly workaround is to put all your code under yet another folder, so you have project_name/project_name/<files?. Then Github changes the first project_name, but not the subfolder.

My somewhat ugly workaround, for Arduino sketches and libraries, is to download or clone them with the Arduino IDE closed, rename the directory, then open the IDE.