Repository navigation
feat(prepare): add a missing App_Resources/<Platform> from the default template - #6173
Merged
Merged
Conversation
…t template ensureAppResourcesExist only fetched the default template's App_Resources when the whole folder was missing. An app created before Windows support has App_Resources/Android and iOS but no Windows folder, so `ns run windows` needed the folder copied by hand. Prepare now passes the platform's App_Resources folder name. When the app has App_Resources but no folder for that platform, the CLI copies it from the default template, or warns when the template has none.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ensureAppResourcesExistonly pulls the default template'sApp_Resourceswhen the app has noApp_Resourcesfolder at all. An app created before Windows support hasApp_Resources/AndroidandApp_Resources/iOSbut noWindowsfolder, so adding the platform meant copying the folder over by hand.Changes
prepareCorepasses the platform'sApp_Resourcesfolder name (mobileHelper.normalizePlatformName) toensureAppResourcesExist.App_Resourcesexists but that folder doesn't, the CLI copies it from the default template. When the template has no such folder, it logs a warning and continues.getDefaultTemplateAppResourcesDir.This applies to every platform, not only Windows. For Windows it depends on the default template shipping
App_Resources/Windows(NativeScript/nativescript-app-templates#244). Until that's published, the CLI warns instead.Testing
test/project-service.ts: 5 new tests (whole folder missing, platform folder missing, platform folder present, template without the folder, no platform passed). The file passes 15 of 15.