protected function getDistributionFilePath(string $path): string
    {
        $postfix = self::DIST_FILENAME_POSTFIX;

        if (empty($path)) {
            $path = $this->fileName;
        }

        // Check if this is the distribution file path
        $pathinfo = pathinfo($path);
        $postfixIndex = strlen($pathinfo['filename']) - strlen($postfix);
        $isDistributionFile = substr($pathinfo['filename'], $postfixIndex) === $postfix;
        if (!$isDistributionFile) {
            $extension = !empty($pathinfo['extension']) ? '.' . $pathinfo['extension'] : '';
            $path = $pathinfo['filename'] . $postfix . $extension;
        }

        return $path;
    }