1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-26 03:15:21 -04:00
hugo-extended/index.js
Jake Jarvis 5bb2ff0eb3
switch to ESM imports (drops node 10.x support)
also download assets to a temp dir instead of ./vendor
2021-08-31 11:56:33 -04:00

14 lines
379 B
JavaScript

import path from "path";
import { fileURLToPath } from "url";
// https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#what-do-i-use-instead-of-__dirname-and-__filename
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const hugo = path.join(
__dirname,
"vendor",
process.platform === "win32" ? "hugo.exe" : "hugo",
);
export default hugo;