Skip to content

Commit

Permalink
update generator move data outside pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayccoll committed Dec 19, 2020
1 parent 15aef9a commit 7da9a87
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions data/themes.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global $, fetch, console */
/* eslint no-undef: "error", semi: 2 */
/* jshint esversion: 6 */

'use strict';

Expand All @@ -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')
Expand Down
16 changes: 8 additions & 8 deletions tools/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit 7da9a87

Please sign in to comment.