protected function getHome()
    {
        if (isset($this->home)) {
            return $this->home;
        }
        // determine home dir
        $home = getenv('CBT_HOME');
        if (!$home) {
            if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
                if (!getenv('APPDATA')) {
                    throw new \RuntimeException(
                        'The APPDATA or CBT_HOME environment variable must be set for cbt to run correctly'
                    );
                }
                $home = strtr(getenv('APPDATA'), '\\', '/') . '/CBT';
            } else {
                if (!getenv('HOME')) {
                    throw new \RuntimeException(
                        'The HOME or CBT_HOME environment variable must be set for cbt to run correctly'
                    );
                }
                $home = rtrim(getenv('HOME'), '/') . '/.config/ctb';
            }
        }

        $this->home = $home;

        return $home;
    }