which.py 447 B

1234567891011121314151617181920212223
  1. import os
  2. from ..utils import deps
  3. __all__ = ['execute']
  4. def _unpack_args(args):
  5. '''Unpack command line arguments
  6. '''
  7. return (args.binary,)
  8. def execute(binary):
  9. '''Print the location of a binary dependency
  10. '''
  11. if binary == 'appimagetool':
  12. path = deps.ensure_appimagetool(dry=True)
  13. else:
  14. path = os.path.join(os.path.dirname(deps.PATCHELF), binary)
  15. if os.path.exists(path):
  16. print(path)