Closed MGlolenstine closed 2 years ago
I've noticed similar issues, though strangely I don't remember encountering this when creating the template. Instead, I get an error in rid_build
if I delete the swift files, even though they seem fully autogenerated. I may be misunderstanding something, but it seems odd to me that a bindgen file would need to exist to be recreated. This also means I can't .gitignore
the files, since collaborators would then be unable to build the project.
This may be unrelated enough to merit a separate PR, and if so I'm sure I'll get to it at some point. But if you fixed it as part of this PR, I also wouldn't complain :)
I'm not sure how most of the plugin/
folder stuff works anyways.
I'm just fixing errors as I come across them.
It might be because I'm on Linux, and some folders fail to create by default.
This isn't a breaking error, but it only gets printed during the template creation.
I'm not using macOS, so I don't know if it breaks the created project for iOS and macOS or not.
I'll be trying to keep it in check, as I've finally started working with RID :)
@SecondFlight I think this is unrelated to what you're describing.
The duplicate is harmless as it is using -p
which does nothing if the directory already exists (on the second call).
Merging this of course though since it's still a bug to have the duplicate. Thanks @MGlolenstine and sorry for the delay.
Actually on second read they aren't duplicates they are folders needed on macos. I can see why this causes issues on Linux since swift isn't used there. Can we wrap those dir creations in an operating system check instead similar to the below @MGlolenstine ?
if [[ $OSTYPE == 'darwin'* ]]; then
echo 'macOS'
fi
Checking uname
should also work (as in the last example here)
@thlorenz Thanks for pointing out the needed os-isolation for dir creation. I'm wondering if I only need to create them on Linux or Windows as well.
Something like the above would probably be the intended way to fix this.
We only copy the template files if it's darwin
.
Or is there another catch that requires those files on other platforms as well?
EDIT: No, that won't work because if the darwin
platform is still wanted for cross-platform development, it'd still have to be generated.
I should probably lock the dir creation instead. However, I'm unsure how I'd check for Windows.
EDIT n°2: Negation seems to solve the problem :)
I've added
mkdir
command that creates missing folders that would otherwise throw errors during thesetup.sh
template creation.Notes:
-p
creates full path, might not work on macOS (haven't used it before)