mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-04-27 08:58:30 -04:00
42 lines
713 B
JavaScript
42 lines
713 B
JavaScript
const PLATFORMS = {
|
|
darwin: 'darwin',
|
|
freebsd: 'freebsd',
|
|
linux: 'linux',
|
|
// sunos: '', not supported
|
|
win32: 'windows'
|
|
};
|
|
|
|
const ARCHS = {
|
|
arm: 'arm',
|
|
ia32: '386',
|
|
x64: 'amd64'
|
|
};
|
|
|
|
const COMPS = {
|
|
darwin: '.zip',
|
|
freebsd: '.zip',
|
|
linux: '.tar.gz',
|
|
// sunos: '', not supported
|
|
win32: '.zip'
|
|
};
|
|
|
|
const EXES = {
|
|
darwin: '',
|
|
freebsd: '',
|
|
linux: '',
|
|
// sunos: '', not supported
|
|
win32: 'windows'
|
|
};
|
|
|
|
module.exports = version => {
|
|
const platform = PLATFORMS[process.platform];
|
|
const arch = ARCHS[process.arch];
|
|
const comp = COMPS[process.platform];
|
|
const exe = EXES[process.platform];
|
|
return {
|
|
binaryName: `hugo_${version}_${platform}_${arch}`,
|
|
comp,
|
|
exe
|
|
};
|
|
}
|