Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
process.env.NODE_ENV === 'development'
? (
path.join(
appPath.split('node_modules')[0],
'node_modules/screenshot-desktop/lib/win32',
)
) : (
path.join(
appPath.split('app.asar')[0],
'screenshot-desktop/',
)
)
);
screenshot.windowsSnapshot = function windowsSnapshot(options = {}) {
return new Promise((resolve, reject) => {
const displayName = options.screen;
const format = options.format || 'jpg';
const tmpPath = temp.path({
suffix: `.${format}`,
});
const imgPath = path.resolve(options.filename || tmpPath);
const displayChoice = displayName ? ` /d "${displayName}"` : '';
exec(
`"${path.join(libPath, 'screenCapture_1.3.2.bat')}" "${imgPath}" ${displayChoice}`,
{
cwd: libPath,
},
(err) => {
const snapshotFunc = () => {
switch (process.platform) {
case 'darwin':
return screenshot.darwinSnapshot;
case 'win32':
case 'windows':
return screenshot.windowsSnapshot;
default:
return screenshot;
}
};
const images = yield eff.all(