2019-03-01 13:24:23 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-07-23 15:21:31 +00:00
|
|
|
|
2019-01-23 10:11:31 +00:00
|
|
|
set -e
|
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
RED='\033[0;31m'
|
|
|
|
GREEN='\033[0;32m'
|
|
|
|
YELLOW='\033[1;33m'
|
|
|
|
NC='\033[0m'
|
|
|
|
PLATFORM=""
|
|
|
|
PLATFORM_FOLDER=""
|
|
|
|
|
|
|
|
#if no arguments passed, inform user about possible ones
|
|
|
|
|
2018-11-21 12:14:43 +00:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo -e "${GREEN}This script should be invoked with platform argument: 'android', 'ios' or 'desktop'${NC}"
|
|
|
|
echo "If invoked with 'mobile' argument it will link: "
|
|
|
|
echo "package.json.mobile -> package.json"
|
|
|
|
echo "etc.."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
case $1 in
|
|
|
|
android | ios)
|
|
|
|
PLATFORM='mobile'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PLATFORM=$1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
PLATFORM_FOLDER="${PLATFORM}_files"
|
2018-07-23 15:21:31 +00:00
|
|
|
fi
|
|
|
|
|
2018-11-30 14:32:30 +00:00
|
|
|
scripts/run-environment-check.sh $1
|
2018-07-23 15:21:31 +00:00
|
|
|
|
2019-01-26 15:36:12 +00:00
|
|
|
echo "Creating link: package.json -> ${PLATFORM_FOLDER}/package.json.orig"
|
2019-01-17 10:10:40 +00:00
|
|
|
ln -sf ${PLATFORM_FOLDER}/package.json.orig package.json
|
2018-07-23 15:21:31 +00:00
|
|
|
|
2018-11-28 18:02:20 +00:00
|
|
|
echo "Creating link: yarn.lock -> ${PLATFORM_FOLDER}/yarn.lock"
|
2019-01-17 10:10:40 +00:00
|
|
|
ln -sf ${PLATFORM_FOLDER}/yarn.lock yarn.lock
|
2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
echo "Creating link: VERSION -> ${PLATFORM_FOLDER}/VERSION"
|
2019-01-17 10:10:40 +00:00
|
|
|
ln -sf ${PLATFORM_FOLDER}/VERSION VERSION
|
|
|
|
|
|
|
|
echo "Creating link: .babelrc -> ${PLATFORM_FOLDER}/.babelrc"
|
|
|
|
ln -sf ${PLATFORM_FOLDER}/.babelrc .babelrc
|
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
echo -e "${GREEN}Finished!${NC}"
|