コード例 #1
0
ファイル: _multipass_command.py プロジェクト: xnox/snapcraft
    def ensure_multipass(cls, platform: str) -> None:
        if shutil.which(cls.provider_cmd):
            return

        if platform == "darwin":
            prompt_installable = True
        elif platform == "linux" and shutil.which("snap"):
            prompt_installable = True
        else:
            prompt_installable = False

        raise errors.ProviderNotFound(
            provider=cls.provider_name,
            prompt_installable=prompt_installable,
            error_message="https://github.com/CanonicalLtd/multipass/releases",
        )
コード例 #2
0
    def ensure_multipass(cls, platform: str) -> None:
        if platform == "win32":
            # Reload path env just in case multipass was installed without
            # launching a new command prompt / shell.
            windows_reload_multipass_path_env()

        if shutil.which(cls.provider_cmd):
            return

        if platform == "darwin":
            prompt_installable = True
        elif platform == "linux" and shutil.which("snap"):
            prompt_installable = True
        elif platform == "win32":
            prompt_installable = True
        else:
            prompt_installable = False

        raise errors.ProviderNotFound(
            provider=cls.provider_name,
            prompt_installable=prompt_installable,
            error_message="https://multipass.run",
        )