windows.js 669 B

1234567891011121314151617
  1. 'use strict';
  2. const path = require('path');
  3. const execa = require('execa');
  4. const arch = require('arch');
  5. // Binaries from: https://github.com/sindresorhus/win-clipboard
  6. const windowBinaryPath = arch() === 'x64' ?
  7. path.join(__dirname, '../fallbacks/windows/clipboard_x86_64.exe') :
  8. path.join(__dirname, '../fallbacks/windows/clipboard_i686.exe');
  9. module.exports = {
  10. copy: async options => execa(windowBinaryPath, ['--copy'], options),
  11. paste: async options => execa.stdout(windowBinaryPath, ['--paste'], options),
  12. copySync: options => execa.sync(windowBinaryPath, ['--copy'], options),
  13. pasteSync: options => execa.sync(windowBinaryPath, ['--paste'], options)
  14. };