Skip to content
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

fix(preProcessPatterns): support glob context paths with special characters #208

Merged

Conversation

clydin
Copy link
Contributor

@clydin clydin commented Jan 24, 2018

context paths with special characters (i.e., glob characters) will cause files to not be copied. This is especially important when the context represents the absolute path to a location and the path is not under the control of the project using the plugin.

Tests have been updated and additional test cases added.

Addresses: angular/angular-cli#9230

@jsf-clabot
Copy link

jsf-clabot commented Jan 24, 2018

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Need more tests. Thanks for PR!

@clydin
Copy link
Contributor Author

clydin commented Jan 24, 2018

Oddly, apply function options ignore ignores all files except those with dots fails on node 4/6 but passes on 8. Will investigate.

@clydin
Copy link
Contributor Author

clydin commented Jan 25, 2018

Alright. Updated to be more comprehensive and with additional test cases.

@clydin clydin force-pushed the escape-glob-context branch from b7bfb1a to 37bf5ba Compare January 25, 2018 15:01
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Look good! Only one change.

@@ -7,6 +7,29 @@ import isObject from './utils/isObject';
// https://www.debuggex.com/r/VH2yS2mvJOitiyr3
const isTemplateLike = /(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(:\d+)?\])|(\[(\w+:)?hash(:\w+)?(:\d+)?\])|(\[\d+\])/;

function escape(context, from) {
Copy link
Member

@alexander-akait alexander-akait Jan 25, 2018

Choose a reason for hiding this comment

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

Move escape to src/utils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@clydin clydin force-pushed the escape-glob-context branch from 37bf5ba to 3ed8b70 Compare January 25, 2018 15:07
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Great job!

@michael-ciniawsky michael-ciniawsky changed the title fix: support glob context paths with special characters fix(preProcessPatterns): support glob context paths with special characters Jan 26, 2018
Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

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

@clydin Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants