Skip to content

Commit 7026fe7

Browse files
authored
Merge pull request #35 from steveoh/master
use windows on windows
2 parents 4c358de + 536b291 commit 7026fe7

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

gulpfile.babel.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import kebabCase from "lodash.kebabcase";
1515
import tomlify from "tomlify-j0.4";
1616

1717
const browserSync = BrowserSync.create();
18-
const hugoBin = `./bin/hugo_0.26_${process.platform}_amd64${process.platform === "windows" ? ".exe" : ""}`;
18+
const platform = getPlatform(process.platform);
19+
const hugoBin = `./bin/hugo_0.26_${platform}_amd64${platform === "windows" ? ".exe" : ""}`;
1920
const defaultArgs = ["-s", "site", "-v"];
2021
const buildArgs = ["-d", "../dist"];
2122

@@ -130,13 +131,12 @@ gulp.task("new-incident", (cb) => {
130131
}
131132

132133
let cmd = "xdg-open";
133-
switch (process.platform) {
134+
switch (platform) {
134135
case "darwin": {
135136
cmd = "open";
136137
break;
137138
}
138-
case "win32":
139-
case "win64": {
139+
case "windows": {
140140
cmd = "start";
141141
break;
142142
}
@@ -159,6 +159,18 @@ gulp.task("new-incident", (cb) => {
159159
});
160160
});
161161

162+
function getPlatform(platform) {
163+
switch (platform) {
164+
case "win32":
165+
case "win64": {
166+
return "windows";
167+
}
168+
default: {
169+
return platform
170+
}
171+
}
172+
}
173+
162174
function generateFrontMatter(frontMatter, answers) {
163175
return `+++
164176
${tomlify(frontMatter, null, 2)}

0 commit comments

Comments
 (0)