Skip to content

Commit 2c87195

Browse files
Find autorest
1 parent dc06c8b commit 2c87195

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 0.6.1 Released on 2019-04-22
3+
## 0.6.2 Released on 2019-04-22
44

55
* Fixed autorest path.
66

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/oad",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"author": {
55
"name": "Microsoft Corporation",
66
"email": "[email protected]",

src/lib/validators/openApiDiff.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,23 @@ export class OpenApiDiff {
139139

140140
// When oad is installed locally
141141
{
142+
142143
const result = path.join(__dirname, "..", "..", "..", "..", "..", "autorest", "app.js")
144+
console.log(result)
143145
if (fs.existsSync(result)) {
144146
return `node ${result}`
145147
}
146148
}
147149

150+
// Try to find autorest in `node-modules`
151+
{
152+
const result = path.resolve("node_modules/.bin/autorest")
153+
console.log(result)
154+
if (fs.existsSync(result)) {
155+
return result
156+
}
157+
}
158+
148159
// Assume that autorest is in the path
149160
return 'autorest'
150161
}

0 commit comments

Comments
 (0)