-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpatch_bootstrap_less.sh
executable file
·38 lines (28 loc) · 1.29 KB
/
patch_bootstrap_less.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
### Script created by @HariantoAtWork
### Date 2015-07-17
# PATHS
ROOT_DIR=`pwd`
RESOURCES_DIR=$ROOT_DIR/resources
RESOURCES_ASSETS=$RESOURCES_DIR #/Editable
BOWER_COMPONENTS=$RESOURCES_ASSETS/bower_components
BOOTSTRAP_LESS=$BOWER_COMPONENTS/bootstrap/less
BOOTSTRAP_FONTS=$BOWER_COMPONENTS/bootstrap/fonts
RESOURCES_LESS_BOOTSTRAP=$RESOURCES_ASSETS/less/bootstrap
PUBLIC_DIR=$ROOT_DIR/public #Editable
PUBLIC_ASSETS=$PUBLIC_DIR #Editable
PUBLIC_FONTS=$PUBLIC_ASSETS/fonts
GLYPHICONS=$PUBLIC_FONTS/glyphicons
# ACTIONS
## Create folder: bootstrap in less
mkdir -p $RESOURCES_LESS_BOOTSTRAP
## Create glyphicons folder in public if not exist
mkdir -p $GLYPHICONS
# copy Bootstrap fonts to pubic
cp $BOOTSTRAP_FONTS/*.* $GLYPHICONS
## reads variables.less (from Bootstrap directory), change path names and save to current directory ### Editable
sed 's|"../fonts/"|"/fonts/glyphicons/"|g' $BOOTSTRAP_LESS/variables.less > $RESOURCES_LESS_BOOTSTRAP/variables.less
## reads bootstrap.less (from Bootstrap directory), change path names, except with the line 'variables' and save to current directory
sed '/variables/!s|@import "|@import "../../bower_components/bootstrap/less/|g' $BOOTSTRAP_LESS/bootstrap.less > $RESOURCES_LESS_BOOTSTRAP/bootstrap.less
cd $ROOT_DIR
echo 'DONE.'