Refactor build process

This commit is contained in:
Cole Bemis 2017-05-13 11:30:06 -07:00
parent 31337f00cc
commit 873c50411f
6 changed files with 22 additions and 27 deletions

View File

@ -4,6 +4,7 @@ exclude:
- CHANGELOG.md
- ISSUE_TEMPLATE.md
- LICENSE
- node_modules
- bin
- sandbox
- stash

15
bin/build-manifest.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
cd ./icons
numFiles=$(ls -1 *.svg | wc -l)
count=0
echo [
for icon in $(ls *.svg)
do
count=$((count + 1))
echo -n " "\"${icon%.svg}\"
(($count == $numFiles)) && echo "" || echo ,
done
echo ]

View File

@ -4,4 +4,4 @@
version=$(grep '"version"' package.json | cut -d '"' -f4)
# compress 'icons' directory into feather-[version].zip
zip -r feather-${version}.zip ./icons/
zip -r feather-${version}.zip ./icons/

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
./bin/make-manifest.sh > manifest.json
./bin/make-zip.sh
jekyll build

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
cd ./icons
n=$(ls -1 | wc -l)
m=0
echo "["
for i in $(ls -1 *.svg | cut -d '.' -f 1 )
do
m=$((m + 1))
echo -n " "\"$i\"
[ "$m" == $n ] && echo "" || echo ","
done
echo "]"

View File

@ -7,12 +7,11 @@
"url": "https://github.com/colebemis/feather.git"
},
"scripts": {
"start": "parallelshell 'jekyll serve' 'npm run watch'",
"watch": "onchange 'icons/**/*' 'package.json' -v -i -- npm run make",
"build": "npm run make && jekyll build",
"make": "npm run make:manifest && npm run make:zip",
"make:manifest": "./bin/make-manifest.sh > manifest.json",
"make:zip": "./bin/make-zip.sh"
"start": "npm run build:manifest && parallelshell 'jekyll serve' 'npm run watch'",
"watch": "onchange 'icons/**/*' -v -- npm run build:manifest",
"build": "npm run build:manifest && npm run build:zip && jekyll build",
"build:manifest": "./bin/build-manifest.sh > manifest.json",
"build:zip": "./bin/build-zip.sh"
},
"license": "MIT",
"devDependencies": {