mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2026-10-04 14:25:39 -04:00
check for a hugoVersion package.json field just in case the package version does not and/or cannot align with Hugo in the future (should never happen!)
This commit is contained in:
2 files changed
+15
-4
No files matched your search
+4
-2
@@ -1,10 +1,12 @@
|
||||
import { readPackageUpSync } from "read-pkg-up";
|
||||
import { execFileSync } from "child_process";
|
||||
import { readPackageUpSync } from "read-pkg-up";
|
||||
|
||||
// This package's version number (should) always match the Hugo release we want.
|
||||
// We check for a `hugoVersion` field in package.json just in case it doesn't
|
||||
// match in the future (from pushing an emergency package update, etc.).
|
||||
export function getPkgVersion() {
|
||||
const { packageJson } = readPackageUpSync();
|
||||
return packageJson.version;
|
||||
return packageJson.hugoVersion || packageJson.version;
|
||||
}
|
||||
|
||||
// Generate the full GitHub URL to a given release file.
|
||||
|
||||
Reference in new issue
Block a user