UNPKG

805 Bapplication/x-shView Raw
1#!/bin/bash
2#set -x
3
4if [ "$(uname)" == "Darwin" ]; then
5 # Do something under Mac OS X platform
6 cd src
7 FILELIST=`find -E . -regex '.+\.(s?css|woff?|eot|ttf|svg)$'`
8 cd ../dist
9 REMOVELIST=`find -E . -regex '.+\.(s?css|woff?|eot|ttf|svg)$'`
10 cd ..
11elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
12 # Do something under GNU/Linux platform
13 cd src
14 FILELIST=`find ./ -regex '.+\.\(s?css\|woff?\|eot\|ttf\|svg\)$'`
15 cd ../dist
16 REMOVELIST=`find ./ -regex '.+\.\(s?css\|woff?\|eot\|ttf\|svg\)$'`
17 cd ..
18fi
19
20if [ -d dist ]; then
21 for i in $REMOVELIST; do
22 rm dist/$i
23 done
24else
25 mkdir dist
26fi
27
28for i in $FILELIST; do
29 #cp --parents $i ../dist;
30 if [ ! -d dist/`dirname $i` ]; then
31 mkdir -p dist/`dirname $i`
32 fi
33 cp -v src/$i dist/`dirname $i`;
34done
35
36#exit 0