本文整理汇总了TypeScript中builder-util.serializeToYaml函数的典型用法代码示例。如果您正苦于以下问题:TypeScript serializeToYaml函数的具体用法?TypeScript serializeToYaml怎么用?TypeScript serializeToYaml使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了serializeToYaml函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: outputFile
await BluebirdPromise.map(updateChannelFileToInfo.values(), async task => {
const publishConfig = task.publishConfiguration
if (publishConfig.publishAutoUpdate === false) {
log.debug({
provider: publishConfig.provider,
reason: "publishAutoUpdate is set to false"
}, "auto update metadata file not published")
return
}
if (task.info.releaseDate == null) {
task.info.releaseDate = releaseDate
}
const fileContent = Buffer.from(serializeToYaml(task.info, false, true))
await outputFile(task.file, fileContent)
packager.dispatchArtifactCreated({
file: task.file,
fileContent,
arch: null,
packager: task.packager,
target: null,
publishConfig,
})
}, {concurrency: 4})
示例2: outputFile
await BluebirdPromise.map(updateChannelFileToInfo.values(), async task => {
task.info.releaseDate = releaseDate
const fileContent = Buffer.from(serializeToYaml(task.info))
await outputFile(task.file, fileContent)
packager.dispatchArtifactCreated({
file: task.file,
fileContent,
arch: null,
packager: task.packager,
target: null,
publishConfig: task.publishConfiguration,
})
}, {concurrency: 4})
示例3: outputFile
export async function writeUpdateConfig<T extends GenericServerOptions | GithubOptions | BintrayOptions | S3Options | SpacesOptions>(data: T): Promise<string> {
const updateConfigPath = path.join(await tmpDir.getTempDir({prefix: "test-update-config"}), "app-update.yml")
await outputFile(updateConfigPath, serializeToYaml(data))
return updateConfigPath
}