File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import kebabCase from "lodash.kebabcase";
15
15
import tomlify from "tomlify-j0.4" ;
16
16
17
17
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" : "" } ` ;
19
20
const defaultArgs = [ "-s" , "site" , "-v" ] ;
20
21
const buildArgs = [ "-d" , "../dist" ] ;
21
22
@@ -130,13 +131,12 @@ gulp.task("new-incident", (cb) => {
130
131
}
131
132
132
133
let cmd = "xdg-open" ;
133
- switch ( process . platform ) {
134
+ switch ( platform ) {
134
135
case "darwin" : {
135
136
cmd = "open" ;
136
137
break ;
137
138
}
138
- case "win32" :
139
- case "win64" : {
139
+ case "windows" : {
140
140
cmd = "start" ;
141
141
break ;
142
142
}
@@ -159,6 +159,18 @@ gulp.task("new-incident", (cb) => {
159
159
} ) ;
160
160
} ) ;
161
161
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
+
162
174
function generateFrontMatter ( frontMatter , answers ) {
163
175
return `+++
164
176
${ tomlify ( frontMatter , null , 2 ) }
You can’t perform that action at this time.
0 commit comments