PicList/scripts/link.js

25 lines
771 B
JavaScript
Raw Normal View History

2022-07-16 23:51:46 -04:00
const pkg = require('../package.json')
const version = pkg.version
// TODO: use the same name format
const generateURL = (platform, ext, prefix = 'PicList-') => {
return `https://release.piclist.cn/latest/${prefix}${version}${platform}${ext}`
2022-07-16 23:51:46 -04:00
}
const platformExtList = [
['-arm64', '.dmg', 'PicList-'],
['-x64', '.dmg', 'PicList-'],
['-universal', '.dmg', 'PicList-'],
['', '.AppImage', 'PicList-'],
['-ia32', '.exe', 'PicList-Setup-'],
['-x64', '.exe', 'PicList-Setup-'],
['', '.exe', 'PicList-Setup-'],
['_amd64', '.snap', 'piclist_']
2022-07-16 23:51:46 -04:00
]
const links = platformExtList.map(([arch, ext, prefix]) => {
const markdownLink = `[${prefix}${version}${arch}${ext}](${generateURL(arch, ext, prefix)})`
return markdownLink
})
console.log(links.join('\n'))