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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [contributions/] [setup/] [beautify.sh] - Diff between revs 43 and 45

Only display areas with differences | Details | Blame | View Log

Rev 43 Rev 45
#!/bin/bash
#!/bin/bash
# Xanthopoulos Constantinos
# Xanthopoulos Constantinos
# Some useful function for my scripts
# Some useful function for my scripts
 
 
function cecho
function cecho
{
{
         echo -e "\033[1m\033[33m$1\033[0m"
         echo -e "\033[1m\033[33m$1\033[0m"
}
}
 
 
 
function cnecho
 
{
 
         echo -e -n "\033[0m\033[33m$1\033[0m"
 
}
 
 
function errormsg
function errormsg
{
{
        echo -e "\033[1m\033[31mError: $1\033[0m\n";
        echo -e "\033[1m\033[31mError: $1\033[0m\n";
        exit 1;
        exit 1;
}
}
 
 
function execcmd
function execcmd
{
{
        # Print Message
        # Print Message
        echo -e "\033[35m$1\033[0m"
        echo -e "\033[35m$1\033[0m"
        # Execute command
        # Execute command
        echo $2
        echo $2
        if [ $DEBUG -ne 1 ];
        if [ $DEBUG -ne 1 ];
        then
        then
                eval $2;
                eval $2;
        fi;
        fi;
        # Check Execution
        # Check Execution
        if [ $? -eq 0 ]
        if [ $? -eq 0 ]
        then
        then
                echo -e "\033[32mSuccessfully \"$1\"\033[0m\n";
                echo -e "\033[32mSuccessfully \"$1\"\033[0m\n";
        else
        else
                errormsg "$1";
                errormsg "$1";
                exit 1;
                exit 1;
 
 
        fi
        fi
}
}
 
 
if [ $DEBUG -eq 1 ]
if [ $DEBUG -eq 1 ]
then
then
        cecho "Debug mode on! Nothing will actually run";
        cecho "Debug mode on! Nothing will actually run";
fi
fi
 
 

powered by: WebSVN 2.1.0

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