This question surprised me a bit - but I have no clue about where to locate my extension directory!!
Is there a simple way to reliably locate it (either programatically or via the UI)?
CiviCRM Stack Exchange is a question and answer site for administrators and users of the CiviCRM Constituent Relationship Management software. It only takes a minute to sign up.Sign up to join this community
You can find your extension directory by going to Administer menu » System Settings » Directories and checking the value for the "Extensions" directory. If there's a token like [civicrm.root], you can determine its value with this technique.
In PHP it looks like this is what I need:
return (new CRM_Extension_System())->getDefaultContainer()->baseDir;
bash I can use
cv ev 'return (new CRM_Extension_System())->getDefaultContainer()->baseDir'
or better still, as pointed out be Tim:
cv ev 'return CRM_Core_Config::singleton()->extensionsDir'
which means this one liner will take you to the directory:
cd `cv ev 'return CRM_Core_Config::singleton()->extensionsDir;' --out=pretty`