Bolt\Composer\ScriptHandler::getDir PHP Method

getDir() protected static method

Gets the directory requested either from configured application or composer's extra section/environment variable.
protected static getDir ( Composer\Script\Event $event, string $name, string | null $default = null ) : string
$event Composer\Script\Event
$name string
$default string | null
return string
    protected static function getDir(Event $event, $name, $default = null)
    {
        try {
            $app = static::getApp($event);
            $dir = $app['resources']->getPath($name);
            $dir = Path::makeRelative($dir, getcwd());
        } catch (BootException $e) {
            $dir = static::getOption($event, $name . '-dir', $default);
        }
        return rtrim($dir, '/');
    }