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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [rc-1.0/] [utils/] [contributions/] [setup/] [beautify.sh] - Blame information for rev 114

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 45 ConX.
function cnecho
11
{
12
         echo -e -n "\033[0m\033[33m$1\033[0m"
13
}
14
 
15 41 rfajardo
function errormsg
16
{
17
        echo -e "\033[1m\033[31mError: $1\033[0m\n";
18
        exit 1;
19
}
20
 
21
function execcmd
22
{
23
        # Print Message
24
        echo -e "\033[35m$1\033[0m"
25
        # Execute command
26
        echo $2
27
        if [ $DEBUG -ne 1 ];
28
        then
29
                eval $2;
30
        fi;
31
        # Check Execution
32
        if [ $? -eq 0 ]
33
        then
34
                echo -e "\033[32mSuccessfully \"$1\"\033[0m\n";
35
        else
36
                errormsg "$1";
37
                exit 1;
38
 
39
        fi
40
}
41
 
42
if [ $DEBUG -eq 1 ]
43
then
44
        cecho "Debug mode on! Nothing will actually run";
45
fi

powered by: WebSVN 2.1.0

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