react-native-navigation的迁移库

exec.js 448B

12345678910111213141516171819202122232425
  1. const cp = require('child_process');
  2. function exec(cmd) {
  3. cp.execSync(cmd, {stdio: ['inherit', 'inherit', 'inherit']});
  4. }
  5. function execSilent(cmd) {
  6. cp.execSync(`${cmd} || true`, {stdio: ['ignore', 'ignore', 'ignore']});
  7. }
  8. function execRead(cmd) {
  9. return String(cp.execSync(cmd, {stdio: ['pipe', 'pipe', 'pipe']})).trim();
  10. }
  11. function execAsync(cmd) {
  12. cp.exec(cmd);
  13. }
  14. module.exports = {
  15. exec,
  16. execSilent,
  17. execRead,
  18. execAsync
  19. };