Skip to content

Commit

Permalink
Update dependencies and bump to 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed May 22, 2020
1 parent dc6c4ee commit f568057
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1,105 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const PROXY_METHODS = ['log', 'status', 'warn', 'error', 'debug', 'trace', 'send
function findRuntimePath() {
const upPkg = readPkgUp.sync();
// case 1: we're in NR itself
if (upPkg.pkg.name === 'node-red') {
if (checkSemver(upPkg.pkg.version,"<0.20.0")) {
return path.join(path.dirname(upPkg.path), upPkg.pkg.main);
if (upPkg.packageJson.name === 'node-red') {
if (checkSemver(upPkg.packageJson.version,"<0.20.0")) {
return path.join(path.dirname(upPkg.path), upPkg.packageJson.main);
} else {
return path.join(path.dirname(upPkg.path),"packages","node_modules","node-red");
}
Expand All @@ -48,8 +48,8 @@ function findRuntimePath() {
return require.resolve('node-red');
} catch (ignored) {}
// case 3: NR is installed alongside node-red-node-test-helper
if ((upPkg.pkg.dependencies && upPkg.pkg.dependencies['node-red']) ||
(upPkg.pkg.devDependencies && upPkg.pkg.devDependencies['node-red'])) {
if ((upPkg.packageJson.dependencies && upPkg.packageJson.dependencies['node-red']) ||
(upPkg.packageJson.devDependencies && upPkg.packageJson.devDependencies['node-red'])) {
const dirpath = path.join(path.dirname(upPkg.path), 'node_modules', 'node-red');
try {
const pkg = require(path.join(dirpath, 'package.json'));
Expand Down
Loading

0 comments on commit f568057

Please sign in to comment.