Skip to content

fix(nsconfig):app resources not filtered on prepare #3429

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

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/services/app-files-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class AppFilesUpdater {

// exclude the app_resources directory from being enumerated
// for copying if it is present in the application sources dir
const appResourcesPathNormalized = path.normalize(projectData.appResourcesDirectoryPath + "\\");
const appResourcesPathNormalized = path.normalize(projectData.appResourcesDirectoryPath + path.sep);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need / at the end ?

Copy link
Contributor

@petekanev petekanev Mar 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rosen-vladimirov
So that there are no false-positives when there is a directory which contains a similar name.

For example, if your resources remain as App_Resources, but you've got another App_Resources123 directory, you don't want that filtered out. Similarly if you rename the resources directory to something more generic like resources, and if you have another resources_home_page, the latter should not be filtered out of the application files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pip3r4o added it so we can filter more accurately. For example if you have Resources folder named "native" and folder named "native_classes" we want to filter only files inside "native".

sourceFiles = sourceFiles.filter(dirName => !path.normalize(dirName).startsWith(appResourcesPathNormalized));

updateAppOptions.beforeCopyAction(sourceFiles);
Expand Down