From f4ddbb474db915bbae2eee08fe2ac0bc77aba5f6 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Sat, 31 May 2014 16:27:29 -0700 Subject: [PATCH] script for submitting to CDNJS --- build/cdnjs-commit.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 build/cdnjs-commit.sh diff --git a/build/cdnjs-commit.sh b/build/cdnjs-commit.sh new file mode 100755 index 0000000..d23b076 --- /dev/null +++ b/build/cdnjs-commit.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +cd "`dirname $0`/.." + +echo +echo "This script assumes the following:" +echo "1. You have run the release script" +echo "2. You have a clone of CDNJS's repo with remotes 'upstream' and 'origin'" +echo "3. You have initialized CDNJS's repo with 'npm install'" +echo + +# 1. make a fork of cdnjs on github +# 2. clone the fork from github (which will be the 'origin') +# 3. `git remote add upstream git@github.com:cdnjs/cdnjs.git` + +version=$(sed -n 's/^.*"version" *: *"\([^"]*\)".*$/\1/p' package.json) +cdnjs_dir="$HOME/Scratch/cdnjs" + +echo "FullCalendar version: $version" +echo "Default CDNJS directory: $cdnjs_dir" +echo + +echo "Enter the location of the CDNJS directory. To keep the default, press enter." +read cdnjs_dir_override + +if [[ "$cdnjs_dir_override" ]] +then + cdnjs_dir="$cdnjs_dir_override" +fi + +cp -r -f dist/cdnjs/* "$cdnjs_dir/ajax/libs/fullcalendar" && \ +cd $cdnjs_dir && \ +npm test && \ +git add "ajax/libs/fullcalendar" && \ +git commit -e -m "fullcalendar v$version" && \ +echo && \ +echo 'Pulling from upstream...' && \ +git pull --rebase upstream master && \ +echo && \ +echo 'DONE. It is now up to you to run `'"cd $cdnjs_dir && git push origin master"'` and submit the PR to CDNJS.' && \ +echo \ No newline at end of file