summaryrefslogtreecommitdiff
path: root/src/script/prepare.sh
blob: dfeaa34b65618cd2e17567b6042bdb45ea4ca2a2 (plain)
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
#!/bin/bash

###########################################################################
# @licence app begin@
# SPDX-License-Identifier: MPL-2.0
#
# Component Name: fuel stop advisor application
# Author: Philippe Colliot <philippe.colliot@mpsa.com>
#
# Copyright (C) 2013-2014, PCA Peugeot Citroen
# 
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# @licence end@
###########################################################################
BASH_DIR=$(dirname "${BASH_SOURCE[0]}")
TARGET_DIR=$BASH_DIR/../hmi
STYLE_SHEETS_GENERATED_INDICATOR=$TARGET_DIR/style-sheets/the-style-sheets-have-been-generated-css.js

function usage
{
 echo "Usage: prepare -i input_directory"
 echo 'Generate a new set of style sheet'
 exit
}

if [ $# -ge 1 ]; then
    if [ $1 = -h ]; then
	usage
    elif [ $1 = -i ]; then
	# Get input directory from the command line
 	shift
        input_dir=$1
   else
        usage
    fi
else
    usage
fi

echo 'Delete the current style sheet'
rm -rf $TARGET_DIR/images/*.png
rm -rf $TARGET_DIR/style-sheets/*-css.js

echo "Prepare the style sheet of fuel stop advisor"
$TARGET_DIR/style_sheet_generator.sh -i $input_dir -o $TARGET_DIR -v -nl

echo "Create the empty file as an indicator"
touch $STYLE_SHEETS_GENERATED_INDICATOR