mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
ci: linux arm64
This commit is contained in:
@@ -3,8 +3,12 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const request = require('request')
|
||||
|
||||
const forceArm64 = process.argv.includes('--force-arm64')
|
||||
|
||||
const filename = os.platform() + '-' + 'pandoc-2.14.2' + (os.platform() === 'win32' ? '.exe' : '')
|
||||
const downloadUrl = 'https://github.com/purocean/yn/releases/download/v1.1/' + filename
|
||||
const downloadUrl = 'https://github.com/purocean/yn/releases/download/v1.1/' + (forceArm64 ? (filename + '-arm64') : filename)
|
||||
|
||||
console.info('Download pandoc', downloadUrl, filename)
|
||||
|
||||
const dir = path.join(__dirname, '../bin')
|
||||
if (!fs.existsSync(dir)) {
|
||||
@@ -13,7 +17,11 @@ if (!fs.existsSync(dir)) {
|
||||
|
||||
const filePath = path.join(dir, filename)
|
||||
if (fs.existsSync(filePath)) {
|
||||
console.warn('Pandoc exists. Skip download.', filePath)
|
||||
if (forceArm64) {
|
||||
fs.unlinkSync(filePath)
|
||||
} else {
|
||||
console.warn('Pandoc exists. Skip download.', filePath)
|
||||
}
|
||||
} else {
|
||||
console.info('Download pandoc', downloadUrl, filename, filePath)
|
||||
request(downloadUrl).pipe(fs.createWriteStream(filePath, { mode: 0o755 }))
|
||||
|
||||
Reference in New Issue
Block a user