Linux 如果未安装,如何绕过IncredBuild控制台?

Linux 如果未安装,如何绕过IncredBuild控制台?,linux,bash,continuous-integration,incredibuild,Linux,Bash,Continuous Integration,Incredibuild,有一些bash脚本在安装了IncrediBuild的构建机器上运行。IncredBuild的思想是利用网络中所有可用的核心来加速构建过程 示例shell脚本: ... ib_console cmake --build . shell脚本不得更改。我想在没有ibu控制台的机器上运行脚本。是否有可能以某种方式模拟它或将调用转发给cmake?将其放入.bashrc文件中: if [ ! -f ´whereis ib_console´ ] then alias ib_console='$@'

有一些bash脚本在安装了IncrediBuild的构建机器上运行。IncredBuild的思想是利用网络中所有可用的核心来加速构建过程

示例shell脚本:

...
ib_console cmake --build .

shell脚本不得更改。我想在没有ibu控制台的机器上运行脚本。是否有可能以某种方式模拟它或将调用转发给cmake?

将其放入
.bashrc
文件中:

if [ ! -f ´whereis ib_console´ ] then
    alias ib_console='$@'
fi
说明:

  • -f检查IBU控制台二进制文件是否存在
  • $@将所有参数合并为一个字符串(然后独立执行)

将其放入您的
.bashrc
文件中:

if [ ! -f ´whereis ib_console´ ] then
    alias ib_console='$@'
fi
说明:

  • -f检查IBU控制台二进制文件是否存在
  • $@将所有参数合并为一个字符串(然后独立执行)

@alex:别名在shell中工作,但在上面的shell脚本中不工作,因为别名在非交互式shell脚本中不会展开

我可以用它来修理它

if ! [ -f 'whereis ib_console' ]; then
    ib_console()
    {
        echo "ib_console dummy: run '$@'..."
        $@
        echo "ib_console dummy: done"
    }
    export -f ib_console
fi

建议在更新后运行“exec bash”。bashrc

@alex:别名可以从shell中工作,但不能在上面的shell脚本中工作,因为别名不会在非交互式shell脚本中展开

我可以用它来修理

if ! [ -f 'whereis ib_console' ]; then
    ib_console()
    {
        echo "ib_console dummy: run '$@'..."
        $@
        echo "ib_console dummy: done"
    }
    export -f ib_console
fi

建议在更新后运行“exec bash”。bashrc

似乎是一个不错且干净的解决方案。看起来是个干净的好办法。顶部