use windows on windows

This commit is contained in:
steveoh 2017-09-12 17:06:47 -06:00
parent 4c358de4a8
commit 536b29149f
1 changed files with 16 additions and 4 deletions

View File

@ -15,7 +15,8 @@ import kebabCase from "lodash.kebabcase";
import tomlify from "tomlify-j0.4";
const browserSync = BrowserSync.create();
const hugoBin = `./bin/hugo_0.26_${process.platform}_amd64${process.platform === "windows" ? ".exe" : ""}`;
const platform = getPlatform(process.platform);
const hugoBin = `./bin/hugo_0.26_${platform}_amd64${platform === "windows" ? ".exe" : ""}`;
const defaultArgs = ["-s", "site", "-v"];
const buildArgs = ["-d", "../dist"];
@ -130,13 +131,12 @@ gulp.task("new-incident", (cb) => {
}
let cmd = "xdg-open";
switch (process.platform) {
switch (platform) {
case "darwin": {
cmd = "open";
break;
}
case "win32":
case "win64": {
case "windows": {
cmd = "start";
break;
}
@ -159,6 +159,18 @@ gulp.task("new-incident", (cb) => {
});
});
function getPlatform(platform) {
switch (platform) {
case "win32":
case "win64": {
return "windows";
}
default: {
return platform
}
}
}
function generateFrontMatter(frontMatter, answers) {
return `+++
${tomlify(frontMatter, null, 2)}