首页 > 解决方案 > Codemagic 后克隆脚本因找不到 base64 命令而失败

问题描述

我正在尝试通过自定义脚本解码 Codemagic 上的环境变量值并得到下一个错误:

post-clone script failed on base64 decode. The command could not be found

我使用的脚本:

#!/bin/sh

echo $ANDROID_FIREBASE_JSON | base64 --decode > $FCI_BUILD_DIR/android/app/google-services.json
echo $IOS_FIREBASE_JSON | base64 --decode > $FCI_BUILD_DIR/ios/Runner/GoogleService-Info.plist

标签: fluttercontinuous-integrationcodemagic

解决方案


可能是您使用浏览器不呈现的一些 Unicode 字符复制粘贴了脚本。只需删除base64命令和--decode选项之间的空格,然后将其添加回来。

您可以在本文中找到更多信息:https ://medium.com/flutter-community/how-to-load-firebase-config-in-codemagic-with-environment-variables-e36e0378b7e6


推荐阅读