Skip to content

Commit

Permalink
Merged PR 32414: #139700 - AzCopy tool in iModelJs unable to detect c…
Browse files Browse the repository at this point in the history
…orrect version of azcopy

#139700 - AzCopy tool in iModelJs unable to detect correct version of azcopy

Related work items: #139700
  • Loading branch information
khanaffan committed Jun 20, 2019
1 parent 91ccbd1 commit 6e82bbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "AzCopy version detect issue fixed",
"packageName": "@bentley/imodeljs-clients-backend",
"type": "none"
}
],
"packageName": "@bentley/imodeljs-clients-backend",
"email": "[email protected]"
}
6 changes: 5 additions & 1 deletion core/clients-backend/src/util/AzCopy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ export class AzCopy extends EventEmitter {
public static getVersion(): string {
if (!AzCopy._currentAzCopyVersion) {
const cmd = execFileSync(AzCopy.execPath, ["--version"], { encoding: "utf8" });
AzCopy._currentAzCopyVersion = cmd.split(" ").slice(-1)[0];
const match = cmd.match(/[0-9]+\.[0-9]+\.[0-9]+/);
if (match)
AzCopy._currentAzCopyVersion = match[0];
else
AzCopy._currentAzCopyVersion = "";
}
return AzCopy._currentAzCopyVersion;
}
Expand Down

0 comments on commit 6e82bbf

Please sign in to comment.