You've already forked hugo-extended
mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2026-06-14 15:45:27 -04:00
When Hugo seems to disappear, just reinstall and then continue normally (#82)
should fix #81 (or at least mitigate it)
This commit is contained in:
+22
-1
@@ -1,12 +1,33 @@
|
||||
/* eslint-env node, mocha */
|
||||
import path from "path";
|
||||
import { execFile } from "child_process";
|
||||
import assert from "assert";
|
||||
import del from "del";
|
||||
import hugo from "../index.js";
|
||||
import { getBinPath } from "../lib/utils.js";
|
||||
|
||||
it("Hugo exists and runs?", async function () {
|
||||
this.timeout(30000); // increase timeout to an excessive 30 seconds for CI
|
||||
|
||||
assert(execFile(hugo, ["env"], function (error, stdout) {
|
||||
const hugoPath = await hugo();
|
||||
|
||||
assert(execFile(hugoPath, ["env"], function (error, stdout) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
console.log(stdout);
|
||||
}));
|
||||
});
|
||||
|
||||
it("Hugo doesn't exist, install it instead of throwing an error", async function () {
|
||||
this.timeout(30000); // increase timeout to an excessive 30 seconds for CI
|
||||
|
||||
// delete binary to ensure it's auto-reinstalled
|
||||
await del(path.dirname(getBinPath()));
|
||||
|
||||
const hugoPath = await hugo();
|
||||
|
||||
assert(execFile(hugoPath, ["version"], function (error, stdout) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user