public function getWorkspacesBasePath($path = null)
    {
        $workspacesBasePath = getenv('SURF_WORKSPACE');
        if (! $workspacesBasePath) {
            $path = $path ?: $this->getHomeDir();
            if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
                if ($workspacesBasePath = getenv('LOCALAPPDATA')) {
                    $workspacesBasePath = Files::concatenatePaths([$workspacesBasePath, 'Surf']);
                } else {
                    $workspacesBasePath = Files::concatenatePaths([$path, 'workspace']);
                }
            } else {
                $workspacesBasePath = Files::concatenatePaths([$path, 'workspace']);
            }
        }
        $this->ensureDirectoryExists($workspacesBasePath);

        return $workspacesBasePath;
    }