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

ensure symlink & link #162

Closed
wants to merge 1 commit into from
Closed

ensure symlink & link #162

wants to merge 1 commit into from

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Aug 4, 2015

No description provided.

@reggi
Copy link
Contributor Author

reggi commented Aug 4, 2015

@jprichardson had no clue that the checks would reset when I forced a commit. ¯\_(ツ)_/¯

Sorry for so many pull requests!

@reggi
Copy link
Contributor Author

reggi commented Aug 4, 2015

I tried moving all the expect calls over to the native assert calls and I ran into a snag with expect().to.contain(), don't know a way of doing that without chai. Or adding underscore for _.contains.

@reggi
Copy link
Contributor Author

reggi commented Aug 4, 2015

@jprichardson Yay! It passed! Wooooohoo. Thoughts?

@jprichardson
Copy link
Owner

Awesome!

Regarding chai, what if...

Instead of this:

expect(fs.readdirSync(dstDir)).to.contain(dstBasename)

this:

assert(fs.readdirSync(dstDir).indexOf(dstBasename) >= 0)

@reggi
Copy link
Contributor Author

reggi commented Aug 4, 2015

@jprichardson updated & passed removed chai as a dev-dependancy.

@reggi
Copy link
Contributor Author

reggi commented Aug 5, 2015

@jprichardson Just realized this still creates the directories even if the ensureLink throws an error. Thoughts? Should I check if both files exist then mkdirs? If they don't exist what errors should be returned? I could use lstat instead of exist and run search and replace for the function name lstat in the native node error message.

So for both srcpath and dstpath with lstat:

"Error: ENOENT: no such file or directory, lstat './mysource.txt'".replace("lstat", "link")

This would keep errors consistent across different versions of node.

@jprichardson
Copy link
Owner

Just realized this still creates the directories even if the ensureLink throws an error.

Good catch.

Should I check if both files exist then mkdirs? If they don't exist what errors should be returned? I could use lstat instead of exist and run search and replace for the function name lstat in the native node error message.

I really like this idea.

@reggi
Copy link
Contributor Author

reggi commented Aug 6, 2015

moving branch off of master to a squashed version of the feature development branch

@reggi reggi closed this Aug 6, 2015
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 this pull request may close these issues.

2 participants