1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-09-15 22:35:31 -04:00

yarn ➡️ pnpm

This commit is contained in:
2024-06-04 11:50:38 -04:00
parent 5d6d26d967
commit 1ce5f5bc80
8 changed files with 2729 additions and 1920 deletions

View File

@@ -23,14 +23,12 @@ async function install() {
const binFile = getBinFilename();
// stop here if there's nothing we can download
if (!releaseFile) {
if (!releaseFile)
throw new Error(`Are you sure this platform is supported? See: https://github.com/gohugoio/hugo/releases/tag/v${version}`);
}
// warn if platform doesn't support Hugo Extended, proceed with vanilla Hugo
if (!isExtended(releaseFile)) {
if (!isExtended(releaseFile))
console.warn(`${logSymbols.info} Hugo Extended isn't supported on this platform, downloading vanilla Hugo instead.`);
}
// download release from GitHub and verify its checksum
const download = await downloader(getReleaseUrl(version, releaseFile), {

View File

@@ -44,14 +44,12 @@ export function getBinVersion(bin) {
// Simply detect if the given file exists.
export function doesBinExist(bin) {
try {
if (fs.existsSync(bin)) {
if (fs.existsSync(bin))
return true;
}
} catch (error) {
// something bad happened besides Hugo not existing
if (error.code !== "ENOENT") {
if (error.code !== "ENOENT")
throw error;
}
return false;
}