Fixed merge conflicts
This commit is contained in:
parent
4d7ce43755
commit
4ce99863c4
133 changed files with 74506 additions and 53064 deletions
21
lib/utils/paste.js
Normal file
21
lib/utils/paste.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import {clipboard} from 'electron';
|
||||
|
||||
const getPath = platform => {
|
||||
switch (platform) {
|
||||
case 'darwin': {
|
||||
const filepath = clipboard.read('public.file-url');
|
||||
return filepath.replace('file://', '');
|
||||
}
|
||||
case 'win32': {
|
||||
const filepath = clipboard.read('FileNameW');
|
||||
return filepath.replace(new RegExp(String.fromCharCode(0), 'g'), '');
|
||||
}
|
||||
// Linux already pastes full path
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export default function processClipboard() {
|
||||
return getPath(process.platform);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue