Closed pe1mew closed 3 years ago
I have rebased the fork and added the new batch file. A PR will follow.
Please evaluate changes and Pull when accepted.
I have rebased the fork and added the new batch file.
Seems you merged in my master branch, rather than rebasing on top of it, so now there's even more commits in the PR than less :-) Don't worry, though, I can just clean this up easily when merging.
A PR will follow.
Seems you discovered you can push more commits to updated this PR rather than create a new PR, which is also what I prefer. If you do rebase, you'll have to force push, but that will also work to update the PR (but replaces commits rather than just adding them).
The script installs into a BasicMAC
subdirectory of the target directory (so you would pass your Arduino/libraries
directory to the script), but for consistency with the Linux version of the script, I'd rather have it install into the given directory directly (so you'd pass Arduino/libraries/BasicMAC
to the script). Seems I missed this on my first review, sorry.
You now implemented a "Are you sure" prompt for deleting the old directory. With that, it seems you're already quite close to making this script behave exactly like the Linux version (which would be preferred if possible). That would mean:
-h
or --help
, print usage as now (the linux version only knows --help
, but I think I'll add -h
there as well).--
print an "unknown option" error message (this one is not so important and can be omitted if needed)This would mean dropping the --create
and --replace
arguments (I proposed the latter mostly since I wasn't sure how complex a "remove existing directory"-prompt would be, but apparently you've figured that one out already).
Git is not always clear to me, but we will get there eventually. I observed the 9 commits that I intended to have "removed" kind of.
With respect to your features: you would only like to have one option -h and the flow you described?
Git is not always clear to me, but we will get there eventually. I observed the 9 commits that I intended to have "removed" kind of.
It's a bit like black magic sometimes :-p
With respect to your features: you would only like to have one option -h and the flow you described?
Yup, then it will work identically between Linux and Windows (except for the missing --link
symlink feature, which is probably hard or impossible on Windows).
Ok, done. The API and behaviour is now compatible with export.sh.
Hi Matthijs, did you finish assessing changes required for PR?
I had another look at the script, there's two questions still open above.
Also, looking again, I see that all directories are created and copied explicitly, including e.g. the individual example directories. This means that if e.g. an example is added, the script needs to be modified. Is there a way we can avoid that? i.e. do a recursive copy? Ideally, the individual mkdirs could also be removed when the copy creates each directory it copies to (leaving only a mkdir for the root and src
directories, like in the bash script).
I had another look at the script, there are two questions still open above.
Great, it took a while.
Also, looking again, I see that all directories are created and copied explicitly, including e.g. the individual example directories. This means that if e.g. an example is added, the script needs to be modified. Is there a way we can avoid that? i.e. do a recursive copy? Ideally, the individual mkdirs could also be removed when the copy creates each directory it copies to (leaving only a mkdir for the root and src directories, like in the bash script).
I will close the PR, commit the changes and do another PR.
@pe1mew I noticed a few more things where your script behaved differently (i.e. export.sh
expects the library directory itself to be passed, while your script expected the parent libraries
directory). Rather than bouncing forward and back, I fired up Windows and played around with the script myself to fix the remaining incompatibilities, but ended up pretty much rewriting the script completely to follow the same interface and structure as the original export.sh
.
The result in is #20, maybe you could see if that version of the batch script works for you and if it looks good?
I'm closing this, now that #20 has been merged.