Skip to content

Instantly share code, notes, and snippets.

@Y-Less
Created August 20, 2018 21:01
Show Gist options
  • Save Y-Less/5b9da34c3ffd2fce3eb4b438297c5980 to your computer and use it in GitHub Desktop.
Save Y-Less/5b9da34c3ffd2fce3eb4b438297c5980 to your computer and use it in GitHub Desktop.
File used to generate all the YSI repo readmes.
declare -a arr=(
"YSI-Coding/y_functional"
"YSI-Coding/y_hooks"
"YSI-Coding/y_inline"
"YSI-Coding/y_malloc"
"YSI-Coding/y_remote"
"YSI-Coding/y_stringhash"
"YSI-Coding/y_timers"
"YSI-Coding/y_unique"
"YSI-Coding/y_va"
"YSI-Core/y_als"
"YSI-Core/y_cell"
"YSI-Core/y_debug"
"YSI-Core/y_master"
"YSI-Core/y_profiling"
"YSI-Core/y_testing"
"YSI-Core/y_utils"
"YSI-Data/y_bintree"
"YSI-Data/y_bit"
"YSI-Data/y_foreach"
"YSI-Data/y_hashmap"
"YSI-Data/y_iterate"
"YSI-Data/y_jaggedarray"
"YSI-Data/y_playerarray"
"YSI-Data/y_playerset"
"YSI-Data/y_sortedarray"
"YSI-Data/y_sparsearray"
"YSI-Extra/y_extra"
"YSI-Extra/y_files"
"YSI-Extra/y_streamer_plugin"
"YSI-Game/y_vehicledata"
"YSI-Players/y_groups"
"YSI-Players/y_languages"
"YSI-Players/y_text"
"YSI-Players/y_users"
"YSI-Server/y_colors"
"YSI-Server/y_colours"
"YSI-Server/y_flooding"
"YSI-Server/y_lock"
"YSI-Server/y_punycode"
"YSI-Server/y_scriptinit"
"YSI-Server/y_stringise"
"YSI-Server/y_stringize"
"YSI-Server/y_td"
"YSI-Storage/y_amx"
"YSI-Storage/y_bitmap"
"YSI-Storage/y_ini"
"YSI-Storage/y_php"
"YSI-Storage/y_svar"
"YSI-Storage/y_uvar"
"YSI-Storage/y_xml"
"YSI-Visual/y_areas"
"YSI-Visual/y_classes"
"YSI-Visual/y_commands"
"YSI-Visual/y_dialog"
"YSI-Visual/y_loader"
"YSI-Visual/y_properties"
"YSI-Visual/y_races"
"YSI-Visual/y_zonenames"
"YSI-Visual/y_zonepulse"
)
for i in ${arr[@]}
do
IFS='/' read -ra l <<< "$i"
echo "${l[0]}/${l[1]}"
cd "${l[0]}@${l[1]}"
file=`cat "${l[0]}/${l[1]}.md"`
#echo "$file"
#IFS='##' read -ra x <<< "$file"
#echo "${x[0]}"
#echo "${x[1]}"
#echo "${x[2]}"
#echo "${x[3]}"
#echo "---"
#echo "${file#*## Documentation}"
#echo "---"
#echo "${file%%## YSI*}" > readme.md
#
#echo "[![sampctl](https://shields.southcla.ws/badge/sampctl-${l[1]}-2f2f2f.svg?style=for-the-badge)](https://github.com/${l[0]}/${l[1]})" >> readme.md
#echo "" >> readme.md
#echo "## Installation" >> readme.md
#echo "" >> readme.md
#echo "To install just this one library:" >> readme.md
#echo "" >> readme.md
#echo "\`\`\`bash" >> readme.md
#echo "sampctl package install ${l[0]}/${l[1]}" >> readme.md
#echo "\`\`\`" >> readme.md
#echo "" >> readme.md
#echo "Include in your code and begin using the library:" >> readme.md
#echo "" >> readme.md
#echo "\`\`\`pawn" >> readme.md
#echo "#include <${l[0]}/${l[1]}>" >> readme.md
#echo "\`\`\`" >> readme.md
#echo "" >> readme.md
#echo "## Documentation" >> readme.md
#echo "" >> readme.md
#echo "* [Quick Start](${l[0]}/${l[1]}/quick-start.md) - One very simple example of getting started with this library." >> readme.md
#echo "* [Features](${l[0]}/${l[1]}/features.md) - More features and examples." >> readme.md
#echo "* [FAQs](${l[0]}/${l[1]}/faqs.md) - Frequently Asked Questions, including errors and solutions." >> readme.md
#echo "* [API](${l[0]}/${l[1]}/api.md) - Full list of all functions and their meaning." >> readme.md
#echo "* [Internal](${l[0]}/${l[1]}/internal.md) - Internal developer documentation for the system." >> readme.md
#echo "" >> readme.md
#echo "## Testing" >> readme.md
#echo "" >> readme.md
#echo "To test, simply run the package:" >> readme.md
#echo "" >> readme.md
#echo "\`\`\`bash" >> readme.md
#echo "sampctl package run" >> readme.md
#echo "\`\`\`" >> readme.md
#echo "" >> readme.md
#cat "../readme.md" >> readme.md
#
#echo "[README](../readme.md)" > "${l[0]}/${l[1]}.md"
#echo "" >> "${l[0]}/${l[1]}.md"
git checkout 5.x
#git add "readme.md"
#git add "${l[0]}/${l[1]}.md"
#git commit -a -m "Better readme."
git commit -a -m "Corrected links."
git push origin 5.x
git rebase 5.x dev
git checkout dev
git push origin dev
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment