Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: fix build command in powershell#980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
codejedi365 merged 1 commit intopython-semantic-release:masterfromJCHacking:fix_powershell_build_command
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletionsemantic_release/cli/commands/version.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@
import os
import subprocess
import sys
from collections import defaultdict
from datetime import datetime
from typing import TYPE_CHECKING

Expand DownExpand Up@@ -160,8 +161,17 @@ def shell(
if not shell:
raise TypeError("'shell' is None")

shell_cmd_param = defaultdict(
lambda: "-c",
{
"cmd": "/c",
"powershell": "-Command",
"pwsh": "-Command",
},
)

return subprocess.run( # noqa: S603
[shell,"-c" ifshell != "cmd" else "/c", cmd],
[shell,shell_cmd_param[shell], cmd],
env=(env or {}),
check=check,
)
Expand Down
6 changes: 3 additions & 3 deletionstests/command_line/test_version.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -658,7 +658,7 @@ def test_version_version_no_verify(
assert head_before in repo_with_single_branch_angular_commits.head.commit.parents


@pytest.mark.parametrize("shell", ("/usr/bin/bash", "/usr/bin/zsh", "powershell"))
@pytest.mark.parametrize("shell", ("/usr/bin/bash", "/usr/bin/zsh"))
def test_version_runs_build_command(
repo_with_git_flow_angular_commits: Repo,
cli_runner: CliRunner,
Expand DownExpand Up@@ -739,7 +739,7 @@ def test_version_runs_build_command(
)


@pytest.mark.parametrize("shell", ("powershell", "cmd"))
@pytest.mark.parametrize("shell", ("powershell", "pwsh", "cmd"))
def test_version_runs_build_command_windows(
repo_with_git_flow_angular_commits: Repo,
cli_runner: CliRunner,
Expand DownExpand Up@@ -801,7 +801,7 @@ def test_version_runs_build_command_windows(
# Evaluate
assert_successful_exit_code(result, cli_cmd)
patched_subprocess_run.assert_called_once_with(
[exe, "-c" if shell!= "cmd" else "/c", build_command],
[exe, "/c" if shell== "cmd" else "-Command", build_command],
check=True,
env={
"NEW_VERSION": "1.2.1", # injected into environment
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp