mirror of
https://github.com/purocean/yn.git
synced 2026-10-12 23:31:39 +08:00
修改下载 pandoc 脚本,文件存在就不下载
This commit is contained in:
@@ -12,6 +12,9 @@ if (!fs.existsSync(dir)) {
|
||||
}
|
||||
|
||||
const filePath = path.join(dir, filename)
|
||||
|
||||
console.log('Download pandoc', downloadUrl, filename, filePath)
|
||||
request(downloadUrl).pipe(fs.createWriteStream(filePath))
|
||||
if (fs.existsSync(filePath)) {
|
||||
console.warn('Pandoc exists. Skip download.', filePath)
|
||||
} else {
|
||||
console.info('Download pandoc', downloadUrl, filename, filePath)
|
||||
request(downloadUrl).pipe(fs.createWriteStream(filePath))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user