Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

resolve before require #9

Merged
merged 1 commit into from
Dec 28, 2016
Merged

Conversation

laggingreflex
Copy link
Contributor

@deepsweet
Copy link
Member

nice one! will test it.

tasks = require(path.resolve(commander.file));
} catch (e) {
modulePath = resolveCwd(`./${commander.file}`);
if (!modulePath || !fs.existsSync(modulePath)) { // eslint-disable-line
Copy link
Member

Choose a reason for hiding this comment

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

trying to find a reason to have !fs.existsSync(modulePath) here and can't. looks like resolveCwd(`./${commander.file}`) already solves all the local path cases. part of my testing code:

let modulePath = null;

if (commander.preset) {
  modulePath = resolveCwd(commander.preset);

  if (!modulePath) {
    console.error(`Unable to resolve "${commander.preset}" preset`);
    process.exit(1);
  }
} else {
  modulePath = resolveCwd(`./${commander.file}`);

  if (!modulePath) {
    console.error(`Unable to find "${commander.file}" file`);
    process.exit(1);
  }
}

const tasks = require(modulePath);

what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's redundant. Updated

@deepsweet deepsweet merged commit 6ac538f into start-runner:master Dec 28, 2016
@laggingreflex
Copy link
Contributor Author

It seems this has been merged and version update to 4.1.1 but not been published to npm yet. Just letting you know in case you forgot to actually publish, unless you meant to publish later which is cool.

Also babel-cli has simple-cli's version 4.0.0 which in theory should install version 4.1.1 but it seems yarn still installs 4.0.0 - yarnpkg/yarn#2364. It'd be great if you updated simple-cli's version in babel-cli as well. It helps bust cached version.

@deepsweet
Copy link
Member

oops, published.

Also babel-cli has simple-cli's version 4.0.0 which in theory should install version 4.1.1 but it seems yarn still installs 4.0.0

that's because yarn.lock (only the last one, ie your in current your project) is already respected. try yarn upgrade or even install it with yarn.lock deleted. so if you install Start and its dependencies in your project for the first time, the latest versions from semver ranges will be installed for sure, but after that it's up to you to bump them every time.

the point of Yarn is that you have to control all the dependencies tree "manually", nothing is updated magically.

@deepsweet
Copy link
Member

ok, now I see the bug.

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

Successfully merging this pull request may close these issues.

2 participants