Skip to main content

A Sublime Text Build System to run Bash scripts in the WSL (Windows Subsystem for Linux).

{
    // ---------------------------------------------------------------------
    // Sublime Text Build System for Bash scripts running in the WSL (Windows Subsystem for Linux)
    //
    // Note: The 'wslpath' command is key, as it translates
    //       the Windows '${file}' path to a Posix path.
    //
    // File: "Bash (WSL).sublime-build"
    //
    // Reference....: https://stackoverflow.com/a/64269611
    // Snippet......: https://jonlabelle.com/snippets/view/json/sublime-text-build-system-for-bash-scripts-running-in-the-wsl
    // ---------------------------------------------------------------------
    "shell_cmd": "ubuntu run \"wslpath '${file}'\" | bash -s",
    "shell": true
}