File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 20
20
const childProcess = require ( 'child_process' )
21
21
22
22
const fs = require ( 'fs' )
23
+ const os = require ( 'os' )
23
24
24
25
const config = require ( '../config' )
25
26
const utils = require ( './utils' )
@@ -134,7 +135,15 @@ module.exports = class {
134
135
execute ( dir , callback ) {
135
136
const name = utils . getTimestamp ( )
136
137
const output = `${ dir } /${ name } .png`
137
- const command = `screencapture -i -x ${ output } `
138
+
139
+ let command
140
+
141
+ if ( os . platform ( ) === 'darwin' ) command = `screencapture -i -x ${ output } `
142
+ if ( os . platform ( ) === 'win32' ) {
143
+ const binary = '../../app/bin/boxcutter.exe'
144
+
145
+ command = `${ binary } "${ output } "`
146
+ }
138
147
139
148
console . log ( 'Capturing selection...' )
140
149
@@ -143,7 +152,9 @@ module.exports = class {
143
152
console . log ( 'Selection captured!' )
144
153
return callback ( output )
145
154
}
155
+
146
156
console . log ( 'Error while capturing!' )
157
+
147
158
return callback ( null , true )
148
159
} )
149
160
}
You can’t perform that action at this time.
0 commit comments