Microsoft AppCenter上预生成脚本的bash脚本错误

Microsoft AppCenter上预生成脚本的bash脚本错误,bash,visual-studio-app-center,Bash,Visual Studio App Center,我对appcenter上的预构建脚本有问题。Appcenter将bash用于预构建脚本。我想在api.js文件中将“qa.api”改为“beta.api” 我尝试了以下方法,但似乎不起作用: #!/usr/bin/env bash if [ "$APPCENTER_BRANCH" != "master" ]; then cd App/Services/ echo "changing QA API to Production API (beta)" sed -i 's/qa

我对appcenter上的预构建脚本有问题。Appcenter将bash用于预构建脚本。我想在api.js文件中将“qa.api”改为“beta.api”

我尝试了以下方法,但似乎不起作用:

#!/usr/bin/env bash
if [ "$APPCENTER_BRANCH" != "master" ];
then
    cd App/Services/
    echo "changing QA API to Production API (beta)"
    sed -i 's/qa.api/beta.api/g' Api.js
fi
所以我简化了它,但它仍然不起作用:

#!/usr/bin/env bash
cd App/Services/
sed -i 's/qa.api/beta.api/g' Api.js`

有什么想法吗?

sed的
-i
选项使用一个参数来指示备份时要向文件名添加的扩展名。与linux版本不同,在macOS上,此扩展参数是必需的

请尝试在此处提供空字符串:
sed-i''s/qa.api/beta.api/g'api.js

用绝对路径替换
App/Services/
?不起作用;(这可能有助于: