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

Exception is thrown in 1.0.8 with relative paths in broccoli-funnel #81

Closed
MiguelMadero opened this issue Nov 3, 2016 · 3 comments · Fixed by #82
Closed

Exception is thrown in 1.0.8 with relative paths in broccoli-funnel #81

MiguelMadero opened this issue Nov 3, 2016 · 3 comments · Fixed by #82

Comments

@MiguelMadero
Copy link

The new code to handle exceptions incorrectly assumes that a symlink doesn't exist and thinks that srcDir is undefined throw new Error('You specified a "srcDir": ' + this.srcDir + 'which does not exist and did not specify"allowEmpty": true.');

The problem seems to be on exists-sync that doesn't expand the path correctly.

Example:

new Funnel('../static/js/', {
					destDir: 'static'
				})

That will create a symlink like:

09:14 AM $ ls -l /Users/mmadero/code-zenefits/yourPeople3-bkp3/component-library/tmp/funnel-input_base_path-9rLzS07l.tmp/0 
lrwxr-xr-x  1 mmadero  staff  77 Nov  3 08:20 /Users/mmadero/code-zenefits/yourPeople3-bkp3/component-library/tmp/funnel-input_base_path-9rLzS07l.tmp/0 -> /Users/mmadero/code-zenefits/yourPeople3-bkp3/component-library/../static/js/

When calling existsSync(/Users/mmadero/code-zenefits/yourPeople3-bkp3/component-library/tmp/funnel-input_base_path-9rLzS07l.tmp/0 );, it returns false.

When it gets the relativeLink on https://github.com/ember-cli/exists-sync/blob/master/index.js#L15 from"/Users/mmadero/code-zenefits/yourPeople3-bkp3/component-library/../static/js/ it goes to Users/mmadero/code-zenefits/yourPeople3-bkp3/component-library/js.

There're no tests for this scenario on exists-sync, but I wanted to raise the issue in both repos in case someone runs into this or in case someone gets a chance to fix it before I do.

Diff

@rwjblue
Copy link
Member

rwjblue commented Nov 3, 2016

/cc @nathanhammond

@nathanhammond
Copy link
Contributor

Dammit @rwjblue! I was this close to keeping this as fs.existsSync! 😜 Going to write a test and revert that part of the change until we can fix exists-sync.

@rwjblue
Copy link
Member

rwjblue commented Nov 4, 2016

HAHA, but just think about how much better we'll be for knowing that exists-sync has this bug!

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

Successfully merging a pull request may close this issue.

3 participants