简体   繁体   English

符号链接SublimeText3构建系统问题(Mac到PC)

[英]Symbolic link SublimeText3 build systems issue (Mac to PC)

Is there a way to either not link the build systems since they won't work cross platform (but let symlink manage everything else), or tell Sublime to 'ignore' a build system with a certain name, so I can create the PC version and not have the linked mac version break the build? 有没有办法不链接构建系统,因为它们无法跨平台工作(但是让symlink管理其他所有内容),或者告诉Sublime“忽略”具有特定名称的构建系统,因此我可以创建PC版本并没有链接的Mac版本破坏了版本?

For example, I have a nodeJS build system and a chrome build (for quick launch to browser), but obviously the paths are different between a Mac and PC, and when symlink does it's magic to my PC, the build systems for each are busted. 例如,我有一个nodeJS构建系统和一个chrome构建(用于快速启动到浏览器),但是显然Mac和PC之间的路径是不同的,并且当symlink对我的PC来说神奇时,每个构建系统都被破坏了。 。

Also I wanted to add - I am trying to keep the builds dynamically selected (via selector), so I don't want a solution that recommends just creating my windows-specific builds and manually selecting them! 我还想添加-我试图保持动态选择(通过选择器)构建,因此我不希望有建议仅创建Windows特定构建并手动选择它们的解决方案! Thx :) 谢谢 :)

After a couple of hours slogging around the interwebs ... it appears sublime build systems take an optional object that will specify what platform to execute the code on. 在几个小时的时间里,在网络间徘徊……崇高的构建系统似乎采用了一个可选对象,该对象将指定在哪个平台上执行代码。

the notation is as follows (modified if your respective paths are different): 表示法如下(如果各自的路径不同,则进行修改):

 {  
    "cmd": ["/usr/local/bin/node", "$file"],
    "selector": "source.js",

    "windows": // this section executes the below only if the OS is windows, otherwise above used
    {
        "cmd": ["C:/Program Files/nodejs/node", "$file"]
    }

}

This way, if you are symlinked from one OS to another, your build system won't break because it can't find the correct path. 这样,如果您从一个操作系统符号链接到另一个操作系统,则构建系统不会中断,因为它找不到正确的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM