Skip to content

Commit

Permalink
Fixed api version check
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksSavelev committed Oct 4, 2024
1 parent d1d8059 commit 5758fcb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/WebPackWrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ export default class WebPackWrap {
const regexFullVersion = /(?<=powerbi-visuals-api@)((?:\d+\.?){1,3})/g;
//get only first 2 parts of version
const regexMajorVersion = /\d+(?:\.\d+)?/;
const listResults = (await exec('npm list powerbi-visuals-api version')).stdout
const installedAPIVersion = listResults.match(regexFullVersion)[0] ?? "not found";
let listResults;
try {
listResults = (await exec('npm list powerbi-visuals-api version')).stdout
} catch (error) {
listResults = error.stdout;
}
const installedAPIVersion = listResults.match(regexFullVersion)?.[0] ?? "not found";
const doesAPIExist = fs.pathExistsSync(path.join(process.cwd(), "node_modules", "powerbi-visuals-api"));

// if the powerbi-visual-api package wasn't installed install the powerbi-visual-api,
Expand Down

0 comments on commit 5758fcb

Please sign in to comment.