node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+48
View File
@@ -0,0 +1,48 @@
'use strict';
const path = require('path');
const execa = require('execa');
const handler = err => {
if (err.code === 'ENOENT') {
throw new Error('Couldn\'t find the required `xsel` binary. On Debian/Ubuntu you can install it with: sudo apt install xsel');
}
throw err;
};
const xsel = path.join(__dirname, '../fallbacks/linux/xsel');
module.exports = {
copy: opts => {
return execa(xsel, ['--clipboard', '--input'], opts)
.catch(() => execa('xsel', ['--clipboard', '--input'], opts))
.catch(handler);
},
paste: opts => {
return execa.stdout(xsel, ['--clipboard', '--output'], opts)
.catch(() => execa.stdout('xsel', ['--clipboard', '--output'], opts))
.catch(handler);
},
copySync: opts => {
try {
return execa.sync(xsel, ['--clipboard', '--input'], opts);
} catch (err) {
try {
return execa.sync('xsel', ['--clipboard', '--input'], opts);
} catch (err) {
handler(err);
}
}
},
pasteSync: opts => {
try {
return execa.sync(xsel, ['--clipboard', '--output'], opts);
} catch (err) {
try {
return execa.sync('xsel', ['--clipboard', '--output'], opts);
} catch (err) {
handler(err);
}
}
}
};
+11
View File
@@ -0,0 +1,11 @@
'use strict';
const execa = require('execa');
const env = Object.assign({}, process.env, {LC_CTYPE: 'UTF-8'});
module.exports = {
copy: opts => execa('pbcopy', Object.assign({}, opts, {env})),
paste: opts => execa.stdout('pbpaste', Object.assign({}, opts, {env})),
copySync: opts => execa.sync('pbcopy', Object.assign({}, opts, {env})),
pasteSync: opts => execa.sync('pbpaste', Object.assign({}, opts, {env}))
};
+29
View File
@@ -0,0 +1,29 @@
'use strict';
const execa = require('execa');
const handler = err => {
if (err.code === 'ENOENT') {
throw new Error('Couldn\'t find the termux-api scripts. You can install them with: apt install termux-api');
}
throw err;
};
module.exports = {
copy: opts => execa('termux-clipboard-set', opts).catch(handler),
paste: opts => execa.stdout('termux-clipboard-get', opts).catch(handler),
copySync: opts => {
try {
return execa.sync('termux-clipboard-set', opts);
} catch (err) {
handler(err);
}
},
pasteSync: opts => {
try {
return execa.sync('termux-clipboard-get', opts);
} catch (err) {
handler(err);
}
}
};
+16
View File
@@ -0,0 +1,16 @@
'use strict';
const path = require('path');
const execa = require('execa');
const arch = require('arch');
// Binaries from: https://github.com/sindresorhus/win-clipboard
const winBinPath = arch() === 'x64' ?
path.join(__dirname, '../fallbacks/windows/clipboard_x86_64.exe') :
path.join(__dirname, '../fallbacks/windows/clipboard_i686.exe');
module.exports = {
copy: opts => execa(winBinPath, ['--copy'], opts),
paste: opts => execa.stdout(winBinPath, ['--paste'], opts),
copySync: opts => execa.sync(winBinPath, ['--copy'], opts),
pasteSync: opts => execa.sync(winBinPath, ['--paste'], opts)
};