Last active
December 11, 2015 19:08
-
-
Save kroq-gar78/4646054 to your computer and use it in GitHub Desktop.
The Elder Scrolls Wiki stub Megaswitch maker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# This script should generate the Megaswitch for the banner message and | |
# categories [[Template:Stub]] on the Elder Scrolls Wiki (http://elderscrolls.wikia.com/Template:Stub) | |
# | |
# Currently, it's at Template:TestTemplate (for testing, duh.) | |
cat="[[Category:" | |
stub="Stub]]" | |
stubs="Stubs]]" | |
inconly="includeonly>" | |
#echo "{{#switch: {{{1|}}}" | |
for i in Skyrim Dawnguard Dragonborn Oblivion "Shivering Isles" Morrowind Tribunal Bloodmoon Daggerfall Arena; do | |
echo "| `echo $i | tr '[A-Z]' '[a-z]'`" | |
echo "| $i = {{$i}} {{#switch: {{{2|}}}" | |
for j in Armor Character Creature Enemy Item Location Quest Spell Weapon; do | |
if [[ ("$i" != "Skyrim") && "$j" == "Enemies" ]]; then # no Oblivion: Enemies or Morrowind: Enemies categories | |
continue | |
fi | |
lower=`echo $j | tr '[A-Z]' '[a-z]'` # make the string lowercase | |
echo " | $j" # add lower case because it will trigger the upper case one | |
echo " | $lower = $lower <$inconly$cat $i: $j $stub</$inconly" | |
done | |
echo " | <$inconly$cat $i: $stubs</$inconly" | |
echo " }}" | |
done | |
echo "| <$inconly$cat $stub</$inconly" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment