Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
spinInterval = null
if (success) {
const timeSpent = prettyMs(Date.now() - stepStart, {
secDecimalDigits: 2
})
currentProgress.text = `[100%] ${currentStep} (${timeSpent})`
currentProgress.succeed()
} else if (currentProgress) {
currentProgress.fail()
}
}
// Start the import!
try {
const {numDocs, warnings} = await sanityImport(inputStream, {
client: importClient,
operation,
onProgress,
allowFailingAssets
})
endTask({success: true})
output.print('Done! Imported %d documents to dataset "%s"\n', numDocs, targetDataset)
printWarnings(warnings, output)
} catch (err) {
endTask({success: false})
let error = err.message
if (!fromInitCommand && err.response && err.response.statusCode === 409) {
error = [