Skip to content

Conversation

@per1234
Copy link

@per1234 per1234 commented May 19, 2018

The Arduino IDE requires that a sketch be located in a folder of the same name. Although the name of the repository does match the sketch name, when GitHub's popular Clone or download > Download ZIP feature is used to download the contents of a repository the branch/release/commit name is appended to the folder name, causing a mismatch.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

The file "iotinator.ino" needs to be inside a sketch folder named "iotinator".
Create this folder, move the file, and continue?

After clicking "OK" the Arduino IDE currently moves only the file iotinator.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

iotinator-master\iotinator\iotinator.ino:18:26: fatal error: initPageHtml.h: No such file or directory

 #include <initPageHtml.h>

The Arduino IDE requires that a sketch be located in a folder of the same name. Although the name of the repository does match the sketch name, when GitHub's popular Clone or download > Download ZIP feature is used to download the contents of a repository the branch/release/commit name is appended to the folder name, causing a mismatch.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

The file "iotinator.ino" needs to be inside a sketch folder named "iotinator".
Create this folder, move the file, and continue?

After clicking "OK" the Arduino IDE currently moves only the file iotinator.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

iotinator-master\iotinator\iotinator.ino:18:26: fatal error: initPageHtml.h: No such file or directory

 #include <initPageHtml.h>
@reivaxy
Copy link
Owner

reivaxy commented May 19, 2018

Sorry but I would rather not change my directory structure, which would imply code changes, because of a structure used inside a Zip file.

Once unzipped, just rename the iotinator-master directory to iotinator.

If you want to keep track of which branch the code comes (master, here), just clone the repo instead of downloading the ZIP ;)

@per1234
Copy link
Author

per1234 commented May 19, 2018

It's your choice of course. Obviously I'm well aware that I should rename the folder to match the sketch name. I've seen storing multi-file sketches in the repository root cause problems time and again for other Arduino users and so I wanted to propose a repository structure that is more friendly to the average user. They rarely will use git clone (heck, even I don't unless I'm actually going to be committing to the repo) and they have no way of knowing that they should rename the folder and so end up with a confusing error.

which would imply code changes

I'm curious, what code changes are you referring to?

@reivaxy
Copy link
Owner

reivaxy commented May 19, 2018

No, my bad, no code changes involved. I first thought it would require to move only iotinator.ino to a subfolder named "iotinator", but actually, all files would be moved there, right ?
Since it was my main concern, I think I'll try your suggestion, thanks.

@reivaxy
Copy link
Owner

reivaxy commented May 26, 2018

I just did what you suggested. It made even more sense since I also had to add a subdirectory for the website files.
And now github zip files can be used right away with no renaming!
Thanks again for this improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants