Skip to content

Instantly share code, notes, and snippets.

@valvallow
Last active January 4, 2017 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valvallow/5754993 to your computer and use it in GitHub Desktop.
Save valvallow/5754993 to your computer and use it in GitHub Desktop.
#!/bin/sh
SLN_NAME=""
while getopts vVn OPT
do
case $OPT in
"v" | "V" ) VERBOSE="TRUE"
shift
;;
"n" ) NO_COLOR="TRUE"
shift
;;
esac
done
if [ "$#" -eq 0 ] ; then
DIR_PATH=`realpath .`
DIR_NAME=`basename $DIR_PATH`
SLN_NAME="$DIR_NAME"".sln"
else
SLN_NAME="$1"
fi
DEVENV="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/devenv.com"
console_printer ()
{
if [ "$VERBOSE" = "TRUE" ] ; then
nkf
else
nkf | grep '===' | sed \
-e 's/=//g' \
-e 's/^.*: /【/' \
-e 's/、/】 【/g' \
-e 's/ $/】/' ;
fi
}
coloring ()
{
if [ "$NO_COLOR" = "TRUE" ] ; then
cat -
else
sed \
-e 's/正常終了/\x1b\[32;01;1m正常終了\x1b\[m/' \
-e 's/失敗/\x1b\[31;01;1m失敗\x1b\[m/' \
-e 's/スキップ/\x1b\[33;01;1mスキップ\x1b\[m/' \
-e 's/更新不要/\x1b\[36;01;1m更新不要\x1b\[m/' ;
fi
}
echo -ne 'clean\t\t'
"$DEVENV" /clean release $SLN_NAME | console_printer | coloring
echo -ne 'rebuild\t\t'
"$DEVENV" /rebuild release $SLN_NAME | console_printer | coloring
echo -ne 'build\t\t'
"$DEVENV" /build release $SLN_NAME | console_printer | coloring
exit
if [ "$VERBOSE" = "TRUE" ] ; then
"$DEVENV" /clean release $SLN_NAME | nkf
"$DEVENV" /rebuild release $SLN_NAME | nkf
"$DEVENV" /build release $SLN_NAME | nkf
else
"$DEVENV" /clean release $SLN_NAME | nkf | egrep '(===|---)' | sed -e 's/========== //g' -e 's/: /\t【/g' -e 's/、/】 【/g' -e 's/$/】/g' -e 's/開始.*$/開始/g'
"$DEVENV" /rebuild release $SLN_NAME | nkf | egrep '(===|---)' | sed -e 's/========== //g' -e 's/: /\t【/g' -e 's/、/】 【/g' -e 's/$/】/g' -e 's/開始.*$/開始/g'
"$DEVENV" /build release $SLN_NAME | nkf | egrep '(===|---)' | sed -e 's/========== //g' -e 's/: /\t\t【/g' -e 's/、/】 【/g' -e 's/$/】/g' -e 's/開始.*$/開始/g'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment