Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// update spinner state
spinner.text = `Build UI5... [${iStep}/${iTotalSteps}] (${
oStepDetails.name
})`
}
}
if (isBuildRequired) {
// update spinner state
spinner.text =
'Build UI5... (this task can take several minutes, please be patient)'
}
// define build Promise
return isBuildRequired
? ui5Build(
`${sDownloadPath}/${sUI5Version}`,
sUI5TargetPath,
sUI5Version,
oBuildOptions
)
.then(sSuccessMessage => {
spinner.succeed(sSuccessMessage)
spinner.start('')
})
.catch(sErrorMessage => {
spinner.fail(sErrorMessage)
spinner.start('')
})
: Promise.resolve()
} catch (error) {
spinner.fail(error)
// update spinner state
spinner.text = `Downloading UI5... [${iStep}/${iTotalSteps}] ${Math.round(
oStepDetails.progress || 0
)}% (${oStepDetails.name})`
}
}
if (isDownloadRequired) {
// update spinner state
spinner.text =
'Downloading UI5... (this task can take several minutes, please be patient)'
}
// return promise
return isDownloadRequired
? ui5Download(sCompiledURL, sDownloadPath, sUI5Version, oDownloadOptions)
.then(sSuccessMessage => {
spinner.succeed(sSuccessMessage)
spinner.start('')
})
.catch(sErrorMessage => {
spinner.fail(sErrorMessage)
spinner.start('')
})
: Promise.resolve()
} catch (error) {
spinner.fail(error)
}
}
tap(oFile => {
ui5CompileLessLib(oFile)
})
)