Skip to content

Instantly share code, notes, and snippets.

@nitriques
Last active March 16, 2018 22:54
Show Gist options
  • Save nitriques/7358731 to your computer and use it in GitHub Desktop.
Save nitriques/7358731 to your computer and use it in GitHub Desktop.
sync-starter-kit.sh
#!/bin/bash
#function syncsk27 {
# pwd=`pwd`;
# cd /q;
# ./sync-starter-kit.2.7.sh $@;
# cd $pwd;
#}
VERSION=2.3.0
copy_only=0
update_only=0
for i in "$@"
do
case $i in
--copy)
echo Copy mode
eval copy_only=1
shift # past argument=value
;;
--update)
echo Update mode
eval update_only=1
shift # past argument=value
;;
--version)
echo $VERSION
exit
;;
--help)
echo --copy --version --help --ext --update
exit
;;
--ext)
for D in extensions-2.7.0/*; do
if [ -d "${D}" ]; then
cd "${D}"
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $branch != "master" ]]; then
echo "*** ${D} is NOT on master ***"
else
echo "${D} is on master"
fi
cd ../..
fi
done
exit
;;
*)
# unknown option
;;
esac
done
if [ $copy_only -eq 0 ]; then
echo '--> Update Symphony'
cd symphony-2.7
git fetch origin
git checkout lts
git pull --ff-only origin lts
git submodule init && git submodule update
cd ..
echo '--> Update Extensions'
for D in extensions-2.7.0/*; do
if [ -d "${D}" ]; then
cd "${D}"
echo ""
echo "${D}"
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $branch != "master" ]]; then
echo "****************************"
echo "Skipping since not on master"
echo "****************************"
else
git stash
git stash drop
#git checkout master
#git fetch origin
git pull --ff-only origin master
git submodule init && git submodule update
#git merge
#git status
fi
cd ../..
fi
done
echo '--> Update Template'
cd symphony-2-template
git fetch origin
git checkout master
git pull origin master
cd ..
echo '--> Update Framework'
cd framework.js
git fetch origin
git checkout master
git pull origin master
cd ..
echo '--> Update Framework Modules'
cd framework.js-modules
git fetch origin
git checkout master
git pull origin master
cd ..
fi # end copy only check
if [ $update_only -eq 0 ]; then
echo '--> Delete'
rm -rf starter-kit-2.7.0/*
mkdir -p starter-kit-2.7.0
echo '--> Copy Symphony...'
cp -R symphony-2.7/* starter-kit-2.7.0/
echo '--> Copy Template'
cp -R symphony-2-template/* starter-kit-2.7.0/
cp -R symphony-2-template/.well-known starter-kit-2.7.0/
rm starter-kit-2.7.0/README.md -f
rm starter-kit-2.7.0/LICENSE.txt -f
echo '--> Copy Framework'
mkdir starter-kit-2.7.0/workspace/assets/js/core
cp -R framework.js/dist/f* starter-kit-2.7.0/workspace/assets/js/core
echo '--> Copy Framework Modules'
cp -R framework.js-modules/src/* starter-kit-2.7.0/workspace/assets/js
echo '--> Copy Extensions'
cp -R extensions-2.7.0/addresslocationfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/ajax_checkbox starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/anti_brute_force starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/author_gravatar starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/backend_language_switcher starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/block_user_agent starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/cache_management starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/cachelite starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/client_logo starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/color_chooser_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/dashboard starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/datetime starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/debugdevkit starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/documenter starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/duplicate_section starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/editor_for_symphony starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/email_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/entry_relationship_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/flang_detection_gtlds starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/flang_redirection starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/frontend_localisation starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/google_analytics_dashboard starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/image_preview starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/image_upload starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/jit_image_manipulation starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/lang_french starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/languages starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/limit_section_entries starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/link_preview starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/logsdevkit starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/markdown starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_checkbox_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_oembed_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_image_upload starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_selectbox_link_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_tag_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/multilingual_upload_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/navigationicons starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/numberfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/oembed_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/order_entries starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/page_lhandles starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/pagesfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/profiledevkit starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/publishnotesfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/publish_tabs starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/random_entries_generator starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/remote_datasource starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/save_and_return starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/selectbox_link_field starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/sri starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/system_date_fields starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/system_log_link starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/systemidfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/textboxfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/tracker starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/uniquecheckboxfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/xmlfield starter-kit-2.7.0/extensions/ && echo '.'
cp -R extensions-2.7.0/xssfilter starter-kit-2.7.0/extensions/ && echo '.'
echo '--> Remove Symphony gruntfiles'
rm starter-kit-2.7.0/gruntfile.js -f
rm starter-kit-2.7.0/package* -f
echo '--> Remove Symphony composer files'
rm starter-kit-2.7.0/composer.* -f
echo '--> Remove .gitkeep'
rm starter-kit-2.7.0/extensions/.gitkeep -f
rm starter-kit-2.7.0/workspace/uploads/config/.gitkeep -f
rm starter-kit-2.7.0/workspace/uploads/metas/.gitkeep -f
echo '--> Un-git the shit (.gitignore)'
find starter-kit-2.7.0/* -iname .gitignore -follow -type f -exec rm -f {} \;
echo '--> Un-git the shit (.git files)'
find starter-kit-2.7.0/* -iname .git -follow -type f -exec rm -f {} \;
echo '--> Un-git the shit (.git directory)'
find starter-kit-2.7.0/* -iname .git -follow -type d -exec rm -rf {} \;
echo '--> Un-git the shit (.gitkeep files)'
find starter-kit-2.7.0/* -iname .gitkeep -follow -type f -exec rm -rf {} \;
echo 'Rename htaccess'
mv starter-kit-2.7.0/htaccess.txt starter-kit-2.7.0/.htaccess
fi # end update only check
echo '--> Done.'
@nitriques
Copy link
Author

Hahaha. Just saw you already found it! Yeah this step might throw a bunch of errors, but it's ok! find runs first and registers some paths that gets deleted when its parent gets deleted.

there a T-Shirt waiting to be made

I looooooove t-shirts. The next one on my list is a black t-shirt with a big and bold white NO on it. I also would want to have a "one person, one account" shirt and another one that says "I do not know your password".

@andrewminton
Copy link

Nice ideas for T-Shirts right there! I want one that just has Esc on it!

@nitriques
Copy link
Author

Hahahaha!!! That's a good one. It could even be Esc:qw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment