我想在 (Windows 10) powershell 中使用以下命令编辑服务:
> oc edit service helloworld -o json
这将打开记事本作为编辑器来编辑文件。但是,我确实想在带有语法突出显示的编辑器中打开它。我在文档中找到了以下内容:
这将导致以下命令。我已将 sublime text 3 添加到我的路径中,但是当我运行命令时:
> OC_EDITOR="subl" oc edit service helloworld -o json
输出是:
OC_EDITOR=subl : The term 'OC_EDITOR=subl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
我尝试了所有类型的变体,例如带/不带引号、sublime_text,但它们似乎不起作用。
从命令行运行 subl 或 sublime_text 只会打开 sublime text 3。