Skip to content

Commit

Permalink
Change version-detection mechanism (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
babich-a authored Jan 28, 2020
1 parent 6483f26 commit 3bf85f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions commands/themebuider.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ const installThemeBuilder = async version => {
};

const getDevExtremeVersion = () => {
const installedDevExtremePackageJson = path.join(process.cwd(), 'node_modules', 'devextreme', 'package.json');
if(fs.existsSync(installedDevExtremePackageJson)) {
return require(installedDevExtremePackageJson).version;
const lockFileName = path.join(process.cwd(), 'package-lock.json');
if(fs.existsSync(lockFileName)) {
const dependencies = require(lockFileName).dependencies;
if(dependencies && dependencies.devextreme) {
return dependencies.devextreme.version;
}
}

return;
};

Expand Down

0 comments on commit 3bf85f5

Please sign in to comment.