OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [contributions/] [setup/] [beautify.sh] - Blame information for rev 43

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 rfajardo
#!/bin/bash
2
# Xanthopoulos Constantinos
3
# Some useful function for my scripts
4
 
5
function cecho
6
{
7
         echo -e "\033[1m\033[33m$1\033[0m"
8
}
9
 
10
function errormsg
11
{
12
        echo -e "\033[1m\033[31mError: $1\033[0m\n";
13
        exit 1;
14
}
15
 
16
function execcmd
17
{
18
        # Print Message
19
        echo -e "\033[35m$1\033[0m"
20
        # Execute command
21
        echo $2
22
        if [ $DEBUG -ne 1 ];
23
        then
24
                eval $2;
25
        fi;
26
        # Check Execution
27
        if [ $? -eq 0 ]
28
        then
29
                echo -e "\033[32mSuccessfully \"$1\"\033[0m\n";
30
        else
31
                errormsg "$1";
32
                exit 1;
33
 
34
        fi
35
}
36
 
37
if [ $DEBUG -eq 1 ]
38
then
39
        cecho "Debug mode on! Nothing will actually run";
40
fi

powered by: WebSVN 2.1.0

© copyright 1999-2020 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.