isWatchmanInstalled.js 766 B

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = isWatchmanInstalled;
  6. function _child_process() {
  7. const data = require('child_process');
  8. _child_process = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _util() {
  14. const data = require('util');
  15. _util = function () {
  16. return data;
  17. };
  18. return data;
  19. }
  20. /**
  21. * Copyright (c) Meta Platforms, Inc. and affiliates.
  22. *
  23. * This source code is licensed under the MIT license found in the
  24. * LICENSE file in the root directory of this source tree.
  25. */
  26. async function isWatchmanInstalled() {
  27. try {
  28. await (0, _util().promisify)(_child_process().execFile)('watchman', [
  29. '--version'
  30. ]);
  31. return true;
  32. } catch {
  33. return false;
  34. }
  35. }