How to setup Sublime Text 3 to build script with MSYS bash?

前提是你 提交于 2019-12-12 04:12:35

问题


Hi i would like to know how to setup sublime text 3 build system to execute bash script threw MSYS bash.

I have try the following build system :

{
    "cmd"       : ["bash", "$file"],
    "selector"  : "source.shell",
    "path"      : "C:/MinGW/msys/1.0/bin"
}

It does look to work, but it can't find gcc, i have try to add multiple path this way :

    "path"      : "C:/MinGW/msys/1.0/bin:C:/MinGW/bin"

But the C: looks to break the thing. I have also try this :

    "path"      : ["C:/MinGW/msys/1.0/bin", "C:/MinGW/bin"]

But it fail also as path is waiting for a string only

     "path"      :"C\:/MinGW/msys/1.0/bin:C\:/MinGW/bin"
     "path"      :"C:/MinGW/msys/1.0/bin\:C:/MinGW/bin"
     "path"      :"${C:/MinGW/msys/1.0/bin}:${C:/MinGW/bin}"

Also fail ...

     "path"      : "/c/MinGW/msys/1.0/bin:/c/MinGW/bin"
     "path"      : "/MinGW/msys/1.0/bin:/MinGW/bin"

Same for those ...

Any working suggestion would be greatly appreciated.


回答1:


To install msys bash with sublime text 3 you just have to copy this in a new build system:

{
    "cmd"       : ["bash", "$file"],
    "selector"  : "source.shell",

    "windows": {
        "path"  : "$path;c:\\mingw\\bin;c:\\mingw\\msys\\1.0\\bin",
        "cmd"   : ["bash", "--login", "-i", "-c", "cd \"$file_path\"; \"$file\""]
    },

    "osx": {
        "path"  : "$PATH:/usr/local/bin:/usr/X11R6/bin:/opt/X11/bin:/usr/texbin"
    }
}

thanks to macite :

https://github.com/macite/sublimebashbuildsystem/blob/master/Bash.sublime-build



来源:https://stackoverflow.com/questions/43139937/how-to-setup-sublime-text-3-to-build-script-with-msys-bash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!