Last active
February 14, 2017 03:40
-
-
Save haiyon/ba6ffa7c1d1c2f01b44334c864fe702c to your computer and use it in GitHub Desktop.
Code Push Publish Shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| today=$(date +%Y%m%d%H%M%S) | |
| log_file="./release/logs/release_${today}.log" | |
| Publish(){ | |
| app_name=$1 platform=$2 varsion=$3 | |
| react-native bundle --platform ${platform} --entry-file index.${platform}.js --bundle-output ./release/${platform}/main.jsbundle --assets-dest ./release/${platform} --dev false | |
| code-push release ${app_name} ./release/${platform}/main.jsbundle ${varsion} | |
| } | |
| CheckCommond(){ | |
| which react-native &> /dev/null; | |
| [ $? -ne 0 ] && { echo 'no react-native-cli installed. npm install -g react-native-cli' && exit;} | |
| which code-push &> /dev/null; | |
| [ $? -ne 0 ] && { echo 'no code-push-cli installed. npm install -g code-push-cli' && exit ;} | |
| } | |
| CheckCommond | |
| echo '------ Please Select Platform ------' | |
| select Platfrom in ios android; | |
| do | |
| read -p 'app name and version: (name version) ' name version | |
| [ "${version}" \= '' ] && continue | |
| case ${Platfrom} in | |
| ios) | |
| Publish ${name} ios ${version} && exit; | |
| ;; | |
| android) | |
| Publish ${name} android ${version} && exit; | |
| ;; | |
| esac | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment