mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-25 02:10:32 -06:00
fix: SDA-1948: write snippet image to user data directory temp folder (#967)
* SDA-1948: write snippet image to user data directory temp folder Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com> * SDA-1948: set tmp dir for tests Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com>
This commit is contained in:
parent
45f3a2f33e
commit
e1a0acdb4e
@ -6,7 +6,7 @@ import * as path from 'path';
|
||||
import { ChildProcess, ExecException, execFile } from 'child_process';
|
||||
import * as util from 'util';
|
||||
import { IScreenSnippet } from '../common/api-interface';
|
||||
import { isDevEnv, isLinux, isMac, isWindowsOS } from '../common/env';
|
||||
import { isDevEnv, isElectronQA, isLinux, isMac, isWindowsOS } from '../common/env';
|
||||
import { i18n } from '../common/i18n';
|
||||
import { logger } from '../common/logger';
|
||||
import { updateAlwaysOnTop } from './window-actions';
|
||||
@ -25,7 +25,14 @@ class ScreenSnippet {
|
||||
private shouldUpdateAlwaysOnTop: boolean = false;
|
||||
|
||||
constructor() {
|
||||
this.tempDir = os.tmpdir();
|
||||
if (isElectronQA) {
|
||||
this.tempDir = os.tmpdir();
|
||||
} else {
|
||||
this.tempDir = path.join(app.getPath('userData'), 'temp');
|
||||
if (!fs.existsSync(this.tempDir)) {
|
||||
fs.mkdirSync(this.tempDir);
|
||||
}
|
||||
}
|
||||
this.captureUtil = isMac ? '/usr/sbin/screencapture' : isDevEnv
|
||||
? path.join(__dirname,
|
||||
'../../../node_modules/screen-snippet/ScreenSnippet.exe')
|
||||
|
Loading…
Reference in New Issue
Block a user