index.js: read package.json as string

This commit is contained in:
XhmikosR authored and GitHub committed 2023-06-05 14:22:41 +03:00
1 parent dda16b264d
commit 17735c5e83
1 file changed
+1 -1
+1 -1
View File
@@ -6,7 +6,7 @@ import BinWrapper from '@xhmikosr/bin-wrapper';
import { packageConfig } from 'pkg-conf';
const pkg = new URL('../package.json', import.meta.url);
const { hugoVersion } = JSON.parse(await fs.readFile(pkg));
const { hugoVersion } = JSON.parse(await fs.readFile(pkg, 'utf8'));
const destDir = path.join(fileURLToPath(new URL('../vendor/', import.meta.url)));
const binName = process.platform === 'win32' ? 'hugo.exe' : 'hugo';