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

Subversion Repositories minsoc

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

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

Line No. Rev Author Line
1 76 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 cnecho
11
{
12
         echo -e -n "\033[0m\033[33m$1\033[0m"
13
}
14
 
15
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
    if [ $DEBUG -ne 1 ];
27
    then
28
        eval $2 1>/dev/null;
29
    fi;
30
    # Check Execution
31
    if [ $? -eq 0 ]
32
    then
33
        if [ -n "$1" ]
34
        then
35
            echo -e "\033[32mSuccessfully \"$1\"\033[0m\n";
36
        fi
37
    else
38
        errormsg "Command: $2 Description: $1";
39
        exit 1;
40
 
41
    fi
42
}
43
 
44
function execcmd
45
{
46
    if [ -z "$2" ]
47
    then
48
        _execcmd "" "$1"
49
    else
50
        _execcmd "$1" "$2"
51
    fi
52
}
53
 
54
if [ $DEBUG -eq 1 ]
55
then
56
    cecho "Debug mode on! Nothing will actually run";
57
fi

powered by: WebSVN 2.1.0

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