Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (raw) => {
if (!raw && process.stdout.isTTY) {
spinner.start();
}
return Promise.resolve(getDataClasses())
.then((dataClasses) => {
if (!raw && process.stdout.isTTY) {
spinner.stop(true);
}
if (dataClasses.length && raw) {
logger.log(JSON.stringify(dataClasses));
} else if (dataClasses.length) {
logger.log(prettyjson.render(dataClasses));
} else if (!dataClasses.length && !raw) {
logger.log(
'No data classes found. This is unexpected - the remote API may be ' +
'having difficulties.',
);
}
})
.catch((err) => {