Prettier RN local-cli

Reviewed By: yungsters

Differential Revision: D7962462

fbshipit-source-id: 0afe2092af8703895de91a6d1400315c3173aa6d
This commit is contained in:
Eli White
2018-05-11 12:43:49 -07:00
committed by Facebook Github Bot
parent 680fb50040
commit aba4ec0c09
209 changed files with 3167 additions and 2071 deletions

View File

@@ -3,13 +3,16 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
var child_process = require('child_process');
var spawn = child_process.spawn;
var path = require('path');
var fs = require('fs');
var fs = require('fs');
const xsel = path.join(__dirname, 'external/xsel');
fs.chmodSync(xsel, '0755');
@@ -18,20 +21,20 @@ fs.chmodSync(xsel, '0755');
*/
function copyToClipBoard(content) {
switch (process.platform) {
case 'darwin':
var child = spawn('pbcopy', []);
child.stdin.end(new Buffer(content, 'utf8'));
return true;
case 'win32':
var child = spawn('clip', []);
child.stdin.end(new Buffer(content, 'utf8'));
return true;
case 'linux':
var child = spawn(xsel, ['--clipboard', '--input']);
child.stdin.end(new Buffer(content, 'utf8'));
return true;
default:
return false;
case 'darwin':
var child = spawn('pbcopy', []);
child.stdin.end(new Buffer(content, 'utf8'));
return true;
case 'win32':
var child = spawn('clip', []);
child.stdin.end(new Buffer(content, 'utf8'));
return true;
case 'linux':
var child = spawn(xsel, ['--clipboard', '--input']);
child.stdin.end(new Buffer(content, 'utf8'));
return true;
default:
return false;
}
}