如何在cloud9 runner中添加多个命令?

时间:2015-04-17 12:17:51

标签: python virtualenv cloud9-ide

我想创建一个运行器来激活virtualenv并在其中运行python代码。 以下配置无效:

// Create a custom Cloud9 runner - similar to the Sublime build system
// For more information see https://docs.c9.io/custom_runners.html
{
   "cmd" : ["source /home/p2/bin/activate && python", "$file", "$args"],
   "info" : "Started $project_path$file_name",
   "env" : {},
   "selector" : "*\.py"
}

2 个答案:

答案 0 :(得分:3)

我找到了一个解决方案:)

// Create a custom Cloud9 runner - similar to the Sublime build system
// For more information see https://docs.c9.io/custom_runners.html
{
    "cmd" : ["/home/p2/bin/python", "$file", "$args"],
    "info" : "Started $project_path$file_name",
    "env" : {},
    "selector" : "^*\\.py$"
}

答案 1 :(得分:2)

您也可以通过bash -c

传递命令