-
-
Notifications
You must be signed in to change notification settings - Fork 431
Subfolder structure of sketch lost after "Save As" operation #2077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @jsmwrench. Thanks for your report.
Please check to see whether the unexpected 36 files are also present in the folder on that external drive. A common misconception is that an Arduino sketch is a file. The sketch is actually a folder. When you do a "Save As" operation with a sketch, all the files from the original sketch folder are saved to the folder that is the target of the "Save As" operation. So if you had previously placed all those 36 files in the original sketch folder then it is expected that they would also be present in the new folder as well. |
Save as is also dumping All Files from all sub folders into the Sketch folder. Original Sketch Folder Containing only the Sketch and a data folder. Data folder contains 4xfile.txt files. Open Sketch click "Save As" and as you can see now the new Sketch folder contains the sketch and all 4 of the data files from the "data" folder that is now gone. @per1234 - All previous versions of the Arduino IDE have been able to maintain file structure when doing a "Save As. " |
Okay, so I just figured out that all of the extra files are from the AccelStepper library. I'm not sure why it took all of those files on "Save As", but it did. I guess this can be closed. |
per1234 This is not normal or expected behavior of "SaveAs" |
I am able to reproduce the fault and have updated the report to clearly describe the bug. Thanks for bringing this to our attention @jsmwrench and for your clarification @fwlrichard |
This commit rewrites how IDE copies sketches as part of the _Save As_ operation. Instead of copying to the destination, IDE copies the sketch into a temporary location, then to the desired destination. This commit drops [`cpy`](https://www.npmjs.com/package/cpy). Ref: sindresorhus/cpy@47b89a7 Closes #2077 Signed-off-by: Akos Kitta <[email protected]>
Describe the problem
Arduino sketches may contain files under subfolders:
data
src
🐛 After a "Save As..." operation, any subfolders are lost and the files are all moved to the root sketch folder.
To reproduce
HasSubfolders.zip
HasSubfolders.ino
file from the unzipped folder.🐛 The subfolder structure of the sketch was lost:
Expected behavior
A "Save As" operation does not make any changes to the sketch file structure.
Arduino IDE version
94d2962
Operating system
Operating system version
Additional context
I bisected the regression to 0ab2826 (the fault does not occur when using 2aad0e3).
Additional reports
Issue checklist
The text was updated successfully, but these errors were encountered: