diff --git a/data/themes.json b/data/themes.json new file mode 100644 index 0000000..341e438 Binary files /dev/null and b/data/themes.json differ diff --git a/gulpfile.js b/gulpfile.js index c399cd6..3ab2807 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,5 @@ /* global $, fetch, console */ /* eslint no-undef: "error", semi: 2 */ -/* jshint esversion: 6 */ 'use strict'; @@ -12,11 +11,11 @@ const { watch } = require('gulp'); -const htmlmin = require('gulp-htmlmin'); +const htmlmin = require('gulp-htmlmin'); const inlinesource = require('gulp-inline-source'); -const rename = require('gulp-rename'); -const browserSync = require('browser-sync').create(); -const sass = require('gulp-sass'); +const rename = require('gulp-rename'); +const browserSync = require('browser-sync').create(); +const sass = require('gulp-sass'); function sassCompile () { return src('./gh-pages/sass/**/main.scss') diff --git a/tools/generate.sh b/tools/generate.sh index a807492..b42c19f 100644 --- a/tools/generate.sh +++ b/tools/generate.sh @@ -48,21 +48,21 @@ createColors() { mkdir -p $SCRIPT_PATH/../.tmp -echo '{' > $SCRIPT_PATH/../gh-pages/data/themes.json -echo ' "themes": [' >> $SCRIPT_PATH/../gh-pages/data/themes.json +echo '{' > $SCRIPT_PATH/../data/themes.json +echo ' "themes": [' >> $SCRIPT_PATH/../data/themes.json ls -1 $SCRIPT_PATH/../themes/*.sh | while read a; do grep "export" $a > "${a/themes/.tmp}"; done ls -1 $SCRIPT_PATH/../.tmp/*.sh | while read a; do sed -i /IMPORTANT/d "${a}"; done -ls -1 $SCRIPT_PATH/../.tmp/*.sh | while read a; do createColors "$a" >> $SCRIPT_PATH/../gh-pages/data/themes.json; done +ls -1 $SCRIPT_PATH/../.tmp/*.sh | while read a; do createColors "$a" >> $SCRIPT_PATH/../data/themes.json; done -echo ' ]' >> $SCRIPT_PATH/../gh-pages/data/themes.json -echo '}' >> $SCRIPT_PATH/../gh-pages/data/themes.json +echo ' ]' >> $SCRIPT_PATH/../data/themes.json +echo '}' >> $SCRIPT_PATH/../data/themes.json -cat $SCRIPT_PATH/../gh-pages/data/themes.json | tr -d " \t\n\r" > $SCRIPT_PATH/../gh-pages/data/themes.json.tmp -sed 's/},]}/}]}/g' $SCRIPT_PATH/../gh-pages/data/themes.json.tmp > $SCRIPT_PATH/../gh-pages/data/themes.json -rm $SCRIPT_PATH/../gh-pages/data/themes.json.tmp +cat $SCRIPT_PATH/../data/themes.json | tr -d " \t\n\r" > $SCRIPT_PATH/../data/themes.json.tmp +sed 's/},]}/}]}/g' $SCRIPT_PATH/../data/themes.json.tmp > $SCRIPT_PATH/../data/themes.json +rm $SCRIPT_PATH/../data/themes.json.tmp echo "" echo "File location:"