我试图通过自定义脚本在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
可能是您用浏览器不会呈现的一些Unicode字符复制脚本。只需删除base64
命令和--decode
选项之间的空间,然后添加回去即可。
您可以在本文中找到其他信息:https://medium.com/flutter-community/how-to-to-fire-firebase-config-in-config-in-codemagic-with-envoriranment-variaiables-e36e0378b78b7e6e6