This repository has been archived by the owner on Aug 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpostinstall.sh
executable file
·76 lines (63 loc) · 2.44 KB
/
postinstall.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
#===============================================================================
#
# FILE: postinstall.sh
#
# USAGE: ./postinstall.sh --type=patch
#
# DESCRIPTION: Depending on when the postinstall.sh script is being run:
# - After running "yarn install" when cloning the style guide repo to your local system.
# (used by people working on the style guide).
# It checks for the "components" directory and "main_cli.scss" file. If it can't find it it creates
# one and injects the necessary tags for gulp to inject the necessary SASS partials.
#
# - After running "npm install" or "yarn install" WITHOUT cloning to your local system.
# (used by people implementing the style guide).
# If checks for the "public" directory and creates the "public/styleguide/vendor" directory.
# It then adds some node_module packages to this directory needed for implementing the style guide.
#
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Gert-Jan Meire, gertjan.meire@digipolis.gent
# COMPANY: Digipolis Gent
# VERSION: 1.0
# CREATED: 12/12/2017
# REVISION: ---
#===============================================================================
#
# Create the necessary directories and move files to them after npm install or yarn install is run.
#
if [ -d "./public" ]; then
rm -rf ./public/styleguide/vendor;
mkdir ./public/styleguide/vendor;
cp -R node_modules/lightgallery ./public/styleguide/vendor/lightgallery;
cp -R node_modules/jquery ./public/styleguide/vendor/jquery;
cp -R node_modules/chosen-js ./public/styleguide/vendor/chosen-js;
cp -R node_modules/masonry-layout ./public/styleguide/vendor/masonry-layout;
fi
#
# This step is only used by Digipolis while building the style guide
# When downloading the NPM package and running npm install or yarn install the "components" directory
# does not exist, so we don't have to create this file here.
#
if [ -d "./components" ]; then
if [ -f components/main_cli.scss ]; then
rm -f components/main_cli.scss
fi
touch components/main_cli.scss
echo "// inject:settings
// endinject
// inject:mixins
// endinject
// inject:base
// endinject
// inject:atoms
// endinject
// inject:molecules
// endinject
// inject:organisms
// endinject" >> components/main_cli.scss
fi