What problem does it solve?
This Skill provides robust shell scripting patterns that ensure your scripts run flawlessly across Windows (Git Bash/MSYS2), WSL, and native Linux/macOS environments, eliminating cross-platform compatibility headaches.
Core Features & Use Cases
- Platform Detection: Accurately identify the operating system (Windows, WSL, Linux, macOS) within your scripts.
- Path Normalization: Handle variations in Windows and WSL path formats to ensure consistency.
- Symlink vs. Junction Handling: Create cross-platform compatible links, using junctions on Windows where symlinks are restricted.
- CRLF Prevention: Ensure shell scripts maintain correct line endings to avoid execution errors.
- Use Case: You need to deploy a setup script that installs dependencies and configures the environment on both a developer's Windows machine and a production Linux server. This Skill ensures your script correctly detects each OS and uses the appropriate commands and path conventions.
Quick Start
Use the cross-platform-shell skill to detect the current operating system and print its name.