From 4abc8796001a811b57a1bdb33fa6042f90875743 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Wed, 13 May 2015 11:12:48 -0700 Subject: [PATCH] Update publish scripts --- scripts/all | 27 +++++++++++++++++++ scripts/deploy | 4 +++ scripts/publish | 6 +++++ scripts/sitemap | 60 ----------------------------------------- scripts/unpublished | 27 +++++++++++++++++++ src/coffee/index.coffee | 1 + 6 files changed, 65 insertions(+), 60 deletions(-) create mode 100755 scripts/all create mode 100755 scripts/publish delete mode 100755 scripts/sitemap create mode 100755 scripts/unpublished diff --git a/scripts/all b/scripts/all new file mode 100755 index 000000000..a642430ee --- /dev/null +++ b/scripts/all @@ -0,0 +1,27 @@ +#!/bin/bash + +USAGE=< + + Executes a command for this project and each project related to this one. + Related projects must include this project's name as a prefix in their name + to be considered related. + +END + +COMMAND="$1" +[[ "$COMMAND" == "" ]] && echo $USAGE && exit 1 + +SRC_ROOT="/src" +BASE_NAME=$(basename $PWD) + +pushd $SRC_ROOT &>/dev/null + +for MODULE in $(ls | grep "$BASE_NAME"); do + cd "$SRC_ROOT/$MODULE" + if [[ -e './scripts/unpublished' ]]; then + ./scripts/unpublished + fi +done + +popd &>/dev/null diff --git a/scripts/deploy b/scripts/deploy index fc13a62f1..b9b497b43 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -1,5 +1,9 @@ #!/bin/bash +USAGE=< - modVersionDataFile = "../crafting-guide-data/data/#{modSlug}/versions/#{modVersion.version}/mod-version.cg" - modVersionParser = new ModVersionParser model:modVersion - modVersionParser.parse fs.readFileSync modVersionDataFile, 'utf-8' - - modVersion.eachItem (item)-> - itemSlugs[item.slug] = item.slug - - for tutorial in mod.tutorials - tutorialSlugs.push mod:mod.slug, tutorial:tutorial.slug - -for modSlug in _.values(modSlugs).sort() - urls.push base + "/browse/#{modSlug}/" - -for tutorialSlug in tutorialSlugs - urls.push base + "/browse/#{tutorialSlug.mod}/tutorials/#{tutorialSlug.tutorial}/" - -for key in _.keys(itemSlugs).sort() - itemSlug = itemSlugs[key] - urls.push base + "/browse/#{itemSlug.mod}/#{itemSlug.item}/" - -for url in urls - console.log url diff --git a/scripts/unpublished b/scripts/unpublished new file mode 100755 index 000000000..ec694fed5 --- /dev/null +++ b/scripts/unpublished @@ -0,0 +1,27 @@ +#!/bin/bash + +MODULE=$(basename $PWD) +QUIET="NO" +while [[ "$1" != "" ]]; do + case "$1" in + "-q") QUIET="YES";; + esac + shift +done + +CHANGES=$(git log --oneline production..master | while read LINE; do echo " $LINE"; done) + +if [[ "$CHANGES" != "" ]]; then + printf "\nUndeployed changes for $MODULE:\n$CHANGES\n\n" +elif [[ "$QUIET" == "NO" ]]; then + printf "No undeployed changes for $MODULE\n\n" +fi + +VERSION=$(cat package.json | grep "version" | sed 's/.*"version": "\(.*\)",$/\1/') +CHANGES=$(git log --oneline "v$VERSION"..master | while read LINE; do echo " $LINE"; done) + +if [[ "$CHANGES" != "" ]]; then + printf "\nUnpublished NPM module changes for $MODULE:\n$CHANGES\n\n" +else + printf "No unpublished NPM module changes for $MODULE\n\n" +fi diff --git a/src/coffee/index.coffee b/src/coffee/index.coffee index 4952db8fd..492aa961a 100644 --- a/src/coffee/index.coffee +++ b/src/coffee/index.coffee @@ -13,6 +13,7 @@ mixins = require './underscore_mixins' _.mixin mixins module.exports = + constants: require './constants' Mod: require './models/mod' ModParser: require './models/mod_parser' ModVersion: require './models/mod_version'