Skip to content

Commit 074b03e

Browse files
committed
feat(cli): handle provider schema type
1 parent 55e6468 commit 074b03e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/commands/scan.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import chalk from 'chalk'
22
import fs from 'fs'
33
import path from 'path'
4-
import { Opts, pluginMap, PluginType, ProviderData, StorageEngine } from '@cloudgraph/sdk'
4+
import {
5+
Opts,
6+
pluginMap,
7+
PluginType,
8+
ProviderData,
9+
StorageEngine,
10+
} from '@cloudgraph/sdk'
511
import { range } from 'lodash'
612
import { print } from 'graphql'
713

@@ -218,7 +224,11 @@ export default class Scan extends Command {
218224
provider
219225
)}`
220226
)
221-
const providerSchema: string = print(providerClient.getSchema())
227+
228+
const rawSchema = providerClient.getSchema()
229+
const providerSchema: string =
230+
typeof rawSchema === 'object' ? print(rawSchema) : rawSchema
231+
222232
if (!providerSchema) {
223233
this.logger.warn(`No schema found for ${provider}, moving on`)
224234
continue // eslint-disable-line no-continue
@@ -306,7 +316,7 @@ export default class Scan extends Command {
306316
isRunning: storageRunning,
307317
engine: storageEngine,
308318
},
309-
providerData: allProviderData
319+
providerData: allProviderData,
310320
})
311321
}
312322

0 commit comments

Comments
 (0)