Fix Windows/PowerShell invocation of superpowers-codex#427
Conversation
Windows doesn't respect shebangs, so directly invoking the extensionless superpowers-codex script triggers an "Open with" dialog. Prefix all invocations with `node` (harmless on Unix, required on Windows) and add a .cmd wrapper for manual invocation on Windows. Fixes #285, #243 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This change is part of the following stack: Change managed by git-spice. |
📝 WalkthroughWalkthroughThis PR updates command invocations across installation and documentation files to explicitly use Node.js when running the superpowers-codex tool, and adds a Windows batch file wrapper for improved cross-platform compatibility. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.codex/superpowers-codex.cmd:
- Line 1: The .codex/superpowers-codex.cmd file currently uses Unix line endings
(LF) which breaks Windows batch parsing; convert this file to Windows CRLF line
endings so the single line "@node "%~dp0superpowers-codex" %*" is terminated
with CRLF—either run a line-ending conversion (e.g., unix2dos or sed adding \r)
on .codex/superpowers-codex.cmd or add a .gitattributes entry ("*.cmd text
eol=crlf") and commit so Git normalizes future commits.
🧹 Nitpick comments (1)
docs/README.codex.md (1)
53-54: Optional: Consider the markdownlint warnings.The static analysis tool flagged missing language specifiers for the fenced code blocks on these lines. However, these blocks appear to contain natural language instructions for Codex (e.g., "Run node ...") rather than executable code, so leaving them untagged may be intentional. If you want to address the linter warnings, you could add a language tag like
textorplaintext, but this is purely stylistic.📝 Optional: Add language specifiers
-``` +```text Run node ~/.codex/superpowers/.codex/superpowers-codex use-skill superpowers:brainstorming```diff -``` +```text Run node ~/.codex/superpowers/.codex/superpowers-codex bootstrap</details> Also applies to: 59-60 </blockquote></details> </blockquote></details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| @@ -0,0 +1 @@ | |||
| @node "%~dp0superpowers-codex" %* | |||
There was a problem hiding this comment.
Critical: Convert to Windows line endings (CRLF).
The batch file currently uses Unix line endings (LF), which can cause script malfunction on Windows due to the batch parser's sensitivity to line endings. This can result in GOTO/CALL label parsing failures and unexpected behavior.
🔧 Fix line endings
Convert the file to Windows line endings (CRLF). You can use:
#!/bin/bash
# Convert line endings to CRLF
unix2dos .codex/superpowers-codex.cmd
# Or if unix2dos is not available:
sed -i 's/$/\r/' .codex/superpowers-codex.cmdAlternatively, configure git to handle line endings automatically:
#!/bin/bash
# Add .gitattributes entry for .cmd files
echo "*.cmd text eol=crlf" >> .gitattributes🧰 Tools
🪛 Blinter (1.0.112)
[error] 1-1: Unix line endings detected. Explanation: Batch file uses Unix line endings (LF-only) which can cause GOTO/CALL label parsing failures and script malfunction due to Windows batch parser 512-byte boundary bugs. Recommendation: Convert file to Windows line endings (CRLF). Use tools like dos2unix, notepad++, or configure git with 'git config core.autocrlf true'. Context: File uses Unix line endings (LF-only) - 1 LF sequences found
(E018)
🤖 Prompt for AI Agents
In @.codex/superpowers-codex.cmd at line 1, The .codex/superpowers-codex.cmd
file currently uses Unix line endings (LF) which breaks Windows batch parsing;
convert this file to Windows CRLF line endings so the single line "@node
"%~dp0superpowers-codex" %*" is terminated with CRLF—either run a line-ending
conversion (e.g., unix2dos or sed adding \r) on .codex/superpowers-codex.cmd or
add a .gitattributes entry ("*.cmd text eol=crlf") and commit so Git normalizes
future commits.
Windows doesn't respect shebangs, so directly invoking the extensionless
superpowers-codex script triggers an "Open with" dialog. Prefix all
invocations with
node(harmless on Unix, required on Windows) and adda .cmd wrapper for manual invocation on Windows.
Fixes #285, #243
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context
Summary by CodeRabbit
Release Notes
Documentation
New Features