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

fs.existsSync deprecated, replace with exists-sync #4316

Merged
merged 2 commits into from Jun 21, 2015

Conversation

jasonmit
Copy link
Contributor

#4315

I took a first pass at this, noticed the tests should likely be using tests/helpers/file-utils where possible for exists. Want me to address this as well @stefanpenner

I went ahead and updated the tests to use file-utils.exists

I will squash once thumbs up

@jasonmit jasonmit changed the title fs.existsSync deprecated fs.existsSync deprecated, replace with exists-sync Jun 20, 2015
@@ -26,10 +27,10 @@ function downloaded(item) {
var exists = false;
switch (item) {
case 'node_modules':
exists = fs.existsSync(path.join(root, '.node_modules-tmp'));
exists = exists(path.join(root, '.node_modules-tmp'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Will need to change these so you're not overwriting exists. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@trabus
Copy link
Contributor

trabus commented Jun 20, 2015

I'm wondering if maybe we should go with existsSync for all of it, to prevent any ambiguity about whether it's the async exists or not.

I've updated the issue to reflect.

@jasonmit
Copy link
Contributor Author

I'm wondering if maybe we should go with existsSync for all of it, to prevent any ambiguity about whether it's the async exists or not.

Yup, I agree. I'll update Updated accordingly.

@@ -392,7 +393,7 @@ describe('Acceptance: brocfile-smoke-test', function() {

return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent')
.then(function() {
var exists = fs.existsSync(path.join('.', 'dist', 'assets', appName + '.css'));
var exists = exists(path.join('.', 'dist', 'assets', appName + '.css'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like another one here, but it won't matter when you've changed everything to use existsSync instead.

@trabus
Copy link
Contributor

trabus commented Jun 21, 2015

I will squash once thumbs up

LGTM 👍

@stefanpenner

@jasonmit
Copy link
Contributor Author

Squashed, thanks @trabus for the review

@stefanpenner
Copy link
Contributor

Looks good. That file-utile relative import should likely just point to the actual existsSync no?

@jasonmit
Copy link
Contributor Author

@stefanpenner yes and should already be doing that in this PR

@@ -12,6 +12,7 @@ var runCommand = require('../helpers/run-command');
var acceptance = require('../helpers/acceptance');
var copyFixtureFiles = require('../helpers/copy-fixture-files');
var assertDirEmpty = require('../helpers/assert-dir-empty');
var existsSync = require('../helpers/file-utils').existsSync;
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

file-utils uses exists-sync now https://github.com/jasonmit/ember-cli/blob/exist-sync/tests/helpers/file-utils.js#L4

Perhaps I'm misunderstanding

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, but why bother with the intermediate file at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, will change this shortly

@jasonmit
Copy link
Contributor Author

@stefanpenner updated to remove intermediate file

stefanpenner added a commit that referenced this pull request Jun 21, 2015
fs.existsSync deprecated, replace with exists-sync
@stefanpenner stefanpenner merged commit a337a1f into ember-cli:master Jun 21, 2015
@stefanpenner
Copy link
Contributor

Awesome thanks

@trabus
Copy link
Contributor

trabus commented Jun 21, 2015

@jasonmit Thanks for taking care of this!

@jasonmit jasonmit deleted the exist-sync branch July 30, 2015 23:12
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.

None yet

3 participants