#!/bin/sh

# PAK: Combine all required CodeMirror Modes Javascript JS Source scripts from lib/js/jseditcode/codemirror/mode/%/*.js into one package JS file: lib/js/jseditcode/codemirror/modes.pak.js # r.20200310

THE_JS_FILE=../lib/js/jseditcode/codemirror/modes.pak.js

echo "Regenerating CodeMirror Modes Javascript Package: ${THE_JS_FILE}"

echo "" > ${THE_JS_FILE}
echo "// # JS Package: modes.pak.js :: #START# :: @ generated from lib/js/jseditcode/codemirror/mode/%/*.js" >> ${THE_JS_FILE}
echo "// Included Modes: diff/diff.js ; javascript/javascript.js ; css/css.js ; xml/xml.js ; htmlmixed/htmlmixed.js ; markdown/markdown.js ; yaml/yaml.js ; sql/sql.js ; clike/clike.js ; php/php.js ; toml/toml.js ; go/go.js ; shell/shell.js ; asciiarmor/asciiarmor.js #" >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}
echo "// ### DO NOT EDIT THIS FILE AS IT WILL BE OVERWRITTEN EACH TIME THE INCLUDED SCRIPTS WILL CHANGE !!! ###" >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== diff/diff.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/diff/diff.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== javascript/javascript.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/javascript/javascript.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== css/css.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/css/css.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== xml/xml.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/xml/xml.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== htmlmixed/htmlmixed.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/htmlmixed/htmlmixed.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== markdown/markdown.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/markdown/markdown.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== yaml/yaml.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/yaml/yaml.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== sql/sql.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/sql/sql.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== clike/clike.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/clike/clike.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== php/php.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/php/php.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== toml/toml.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/toml/toml.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== go/go.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/go/go.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== shell/shell.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/shell/shell.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== shell/asciiarmor.js" >> ${THE_JS_FILE}
cat ../lib/js/jseditcode/codemirror/mode/asciiarmor/asciiarmor.js >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "// ===== [#]" >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}
echo "// # JS Package: modes.pak.js :: #END#" >> ${THE_JS_FILE}
echo "" >> ${THE_JS_FILE}

echo "[DONE !]"

# END
