2020TASKS_TEMPLATE = PROJECT_ROOT / "templates" / "tasks-template.md"
2121
2222HAS_PWSH = shutil .which ("pwsh" ) is not None
23- _POWERSHELL = (shutil .which ("powershell.exe" ) or shutil .which ("powershell" )) if os .name == "nt" else None
23+ _WINDOWS_POWERSHELL = (shutil .which ("powershell.exe" ) or shutil .which ("powershell" )) if os .name == "nt" else None
2424
2525
2626# ---------------------------------------------------------------------------
@@ -118,7 +118,7 @@ def _run_bash_format_command(repo: Path, command_name: str) -> subprocess.Comple
118118
119119def _run_powershell_format_command (repo : Path , command_name : str ) -> subprocess .CompletedProcess :
120120 script = repo / ".specify" / "scripts" / "powershell" / "common.ps1"
121- exe = "pwsh" if HAS_PWSH else _POWERSHELL
121+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
122122 return subprocess .run (
123123 [
124124 exe ,
@@ -606,7 +606,7 @@ def test_setup_tasks_bash_errors_without_feature_context(
606606# POWERSHELL TESTS
607607# ===========================================================================
608608
609- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
609+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
610610def test_setup_tasks_ps_core_template_resolved (tasks_repo : Path ) -> None :
611611 """
612612 When the core tasks-template.md is present and all prerequisites are met,
@@ -615,7 +615,7 @@ def test_setup_tasks_ps_core_template_resolved(tasks_repo: Path) -> None:
615615 """
616616 _minimal_feature (tasks_repo )
617617 script = tasks_repo / ".specify" / "scripts" / "powershell" / "setup-tasks.ps1"
618- exe = "pwsh" if HAS_PWSH else _POWERSHELL
618+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
619619
620620 result = subprocess .run (
621621 [exe , "-NoProfile" , "-File" , str (script ), "-Json" ],
@@ -635,7 +635,7 @@ def test_setup_tasks_ps_core_template_resolved(tasks_repo: Path) -> None:
635635 assert tasks_tmpl .name == "tasks-template.md"
636636
637637
638- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
638+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
639639def test_setup_tasks_ps_override_wins (tasks_repo : Path ) -> None :
640640 """
641641 When an override exists at .specify/templates/overrides/tasks-template.md,
@@ -649,7 +649,7 @@ def test_setup_tasks_ps_override_wins(tasks_repo: Path) -> None:
649649 override_file .write_text ("# override tasks template\n " , encoding = "utf-8" )
650650
651651 script = tasks_repo / ".specify" / "scripts" / "powershell" / "setup-tasks.ps1"
652- exe = "pwsh" if HAS_PWSH else _POWERSHELL
652+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
653653
654654 result = subprocess .run (
655655 [exe , "-NoProfile" , "-File" , str (script ), "-Json" ],
@@ -671,7 +671,7 @@ def test_setup_tasks_ps_override_wins(tasks_repo: Path) -> None:
671671 )
672672
673673
674- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
674+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
675675def test_setup_tasks_ps_missing_template_errors (tasks_repo : Path ) -> None :
676676 """
677677 When tasks-template.md is absent from all locations, setup-tasks.ps1 must
@@ -683,7 +683,7 @@ def test_setup_tasks_ps_missing_template_errors(tasks_repo: Path) -> None:
683683 core .unlink ()
684684
685685 script = tasks_repo / ".specify" / "scripts" / "powershell" / "setup-tasks.ps1"
686- exe = "pwsh" if HAS_PWSH else _POWERSHELL
686+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
687687
688688 result = subprocess .run (
689689 [exe , "-NoProfile" , "-File" , str (script ), "-Json" ],
@@ -698,7 +698,7 @@ def test_setup_tasks_ps_missing_template_errors(tasks_repo: Path) -> None:
698698 assert "tasks-template" in result .stderr .lower () or "tasks-template" in result .stdout .lower ()
699699
700700
701- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
701+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
702702def test_powershell_command_hint_normalizes_mixed_separators (
703703 tasks_repo : Path ,
704704) -> None :
@@ -717,7 +717,7 @@ def test_powershell_command_hint_normalizes_mixed_separators(
717717 assert result .stdout .strip () == "/speckit-git-commit"
718718
719719
720- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
720+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
721721def test_powershell_command_hint_preserves_hyphens_inside_segments (
722722 tasks_repo : Path ,
723723) -> None :
@@ -729,7 +729,7 @@ def test_powershell_command_hint_preserves_hyphens_inside_segments(
729729 assert result .stdout .strip () == "/speckit.jira.sync-status"
730730
731731
732- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
732+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
733733def test_setup_tasks_ps_uses_invoke_separator_in_plan_hint (tasks_repo : Path ) -> None :
734734 _write_integration_state (tasks_repo , "claude" , "-" )
735735 feat = tasks_repo / "specs" / "001-my-feature"
@@ -738,7 +738,7 @@ def test_setup_tasks_ps_uses_invoke_separator_in_plan_hint(tasks_repo: Path) ->
738738 _write_feature_json (tasks_repo )
739739
740740 script = tasks_repo / ".specify" / "scripts" / "powershell" / "setup-tasks.ps1"
741- exe = "pwsh" if HAS_PWSH else _POWERSHELL
741+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
742742
743743 result = subprocess .run (
744744 [exe , "-NoProfile" , "-File" , str (script ), "-Json" ],
@@ -755,15 +755,15 @@ def test_setup_tasks_ps_uses_invoke_separator_in_plan_hint(tasks_repo: Path) ->
755755 assert "/speckit.plan" not in output
756756
757757
758- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
758+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
759759def test_check_prerequisites_ps_uses_invoke_separator_in_tasks_hint (
760760 tasks_repo : Path ,
761761) -> None :
762762 _write_integration_state (tasks_repo , "claude" , "-" )
763763 _minimal_feature (tasks_repo )
764764
765765 script = tasks_repo / ".specify" / "scripts" / "powershell" / "check-prerequisites.ps1"
766- exe = "pwsh" if HAS_PWSH else _POWERSHELL
766+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
767767
768768 result = subprocess .run (
769769 [exe , "-NoProfile" , "-File" , str (script ), "-RequireTasks" ],
@@ -780,7 +780,7 @@ def test_check_prerequisites_ps_uses_invoke_separator_in_tasks_hint(
780780 assert "/speckit.tasks" not in output
781781
782782
783- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
783+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
784784def test_setup_tasks_ps_passes_custom_branch_when_feature_json_valid (
785785 tasks_repo : Path ,
786786) -> None :
@@ -801,7 +801,7 @@ def test_setup_tasks_ps_passes_custom_branch_when_feature_json_valid(
801801 _write_feature_json (tasks_repo )
802802
803803 script = tasks_repo / ".specify" / "scripts" / "powershell" / "setup-tasks.ps1"
804- exe = "pwsh" if HAS_PWSH else _POWERSHELL
804+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
805805
806806 result = subprocess .run (
807807 [exe , "-NoProfile" , "-File" , str (script ), "-Json" ],
@@ -815,7 +815,7 @@ def test_setup_tasks_ps_passes_custom_branch_when_feature_json_valid(
815815 assert result .returncode == 0 , result .stderr + result .stdout
816816
817817
818- @pytest .mark .skipif (not (HAS_PWSH or _POWERSHELL ), reason = "no PowerShell available" )
818+ @pytest .mark .skipif (not (HAS_PWSH or _WINDOWS_POWERSHELL ), reason = "no PowerShell available" )
819819def test_setup_tasks_ps_errors_without_feature_context (
820820 tasks_repo : Path ,
821821) -> None :
@@ -826,7 +826,7 @@ def test_setup_tasks_ps_errors_without_feature_context(
826826 (main_feat / "plan.md" ).write_text ("# plan\n " , encoding = "utf-8" )
827827
828828 script = tasks_repo / ".specify" / "scripts" / "powershell" / "setup-tasks.ps1"
829- exe = "pwsh" if HAS_PWSH else _POWERSHELL
829+ exe = "pwsh" if HAS_PWSH else _WINDOWS_POWERSHELL
830830
831831 result = subprocess .run (
832832 [exe , "-NoProfile" , "-File" , str (script ), "-Json" ],
0 commit comments