2017-08-13 01:05:25 +02:00
|
|
|
|
#!/usr/bin/env bash
|
2020-03-05 16:06:18 +01:00
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2017-08-13 01:05:25 +02:00
|
|
|
|
#
|
2017-09-30 23:05:45 +02:00
|
|
|
|
# Usage
|
|
|
|
|
# ---------------
|
|
|
|
|
# 1. Clone second version of Bootstrap in sibling directory named `bs-docs`.
|
|
|
|
|
# 2. Within `bs-docs` copy, switch to `gh-pages` branch.
|
|
|
|
|
# 3. Pull latest, re-bundle, re-npm.
|
|
|
|
|
# 4. Run script.
|
2017-08-13 01:05:25 +02:00
|
|
|
|
|
|
|
|
|
red=$'\e[1;31m'
|
|
|
|
|
green=$'\e[1;32m'
|
2018-03-12 17:59:57 +01:00
|
|
|
|
#blue=$'\e[1;34m'
|
2017-08-13 01:05:25 +02:00
|
|
|
|
magenta=$'\e[1;35m'
|
2018-03-12 17:59:57 +01:00
|
|
|
|
#cyan=$'\e[1;36m'
|
2017-08-13 01:05:25 +02:00
|
|
|
|
end=$'\e[0m'
|
|
|
|
|
|
|
|
|
|
# Get current version from package.json
|
|
|
|
|
current_version=$(node -p "require('./package.json').version")
|
|
|
|
|
|
|
|
|
|
if [[ $# -lt 1 ]]; then
|
2020-03-05 16:06:18 +01:00
|
|
|
|
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" "$red" "$end"
|
2017-08-13 01:05:25 +02:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Pulling latest changes, just to be sure
|
2020-03-05 16:06:18 +01:00
|
|
|
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%sPulling latest changes...%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%s=======================================================\n\n%s" "$magenta" "$end"
|
2019-02-15 10:58:41 +01:00
|
|
|
|
git pull origin master
|
2017-08-13 01:05:25 +02:00
|
|
|
|
|
|
|
|
|
# Update version number
|
2020-03-05 16:06:18 +01:00
|
|
|
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%sUpdating version number...%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
2018-03-12 17:59:57 +01:00
|
|
|
|
npm run release-version "$current_version" "$1"
|
2017-08-13 01:05:25 +02:00
|
|
|
|
|
2018-10-13 15:45:17 +02:00
|
|
|
|
# Build release
|
2020-03-05 16:06:18 +01:00
|
|
|
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%sBuilding release...%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
2018-10-13 15:45:17 +02:00
|
|
|
|
npm run release
|
2017-08-13 01:05:25 +02:00
|
|
|
|
|
|
|
|
|
# Copy the contents of the built docs site over to `bs-docs` repo
|
2020-03-05 16:06:18 +01:00
|
|
|
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%sCopy it over...%s" "$magenta" "$end"
|
|
|
|
|
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
2017-09-30 23:05:45 +02:00
|
|
|
|
cp -rf _gh_pages/. ../bs-docs/
|
|
|
|
|
printf "\nDone!\n"
|
2017-08-13 01:05:25 +02:00
|
|
|
|
|
2020-03-05 16:06:18 +01:00
|
|
|
|
printf "\n%s=======================================================%s" "$green" "$end"
|
|
|
|
|
printf "\n%sSuccess, $1 is ready to review and publish.%s" "$green" "$end"
|
|
|
|
|
printf "\n%s=======================================================\n\n%s" "$green" "$end"
|