view mcabber/hgcset.sh @ 2306:7afb9a0c6409

[PATCH 3/3] Clear input line when switching to vi mode If vi_mode is set to 1 and the user leaves chat mode, clear the input line. Existing text on the input line cannot be sent as a message and will also not be evaluated as a vi command in this situation, so leaving the text on the input line would be confusing.
author Holger Weiß <holger@zedat.fu-berlin.de>
date Fri, 24 Jul 2015 02:52:23 +0200
parents e8f2db654e67
children
line wrap: on
line source

#! /bin/sh

srcdir="$1"
builddir="$2"

if [ ! -f "$srcdir/logprint.h" ]; then
  echo "Unable to find mcabber sources!" >&2
  exit 1
fi

cd "$srcdir"

if which hg > /dev/null 2>&1; then
  cs=$(hg id 2> /dev/null | cut -d' ' -f1)
  if test $? -eq 0; then
    if [ x"$cs" != x ]; then
      grep -q "$cs" "$builddir/hgcset.h" > /dev/null 2>&1 || \
        echo "#define HGCSET \"$cs\"" > "$builddir/hgcset.h"
      exit 0
    fi
  fi
fi

echo > "$builddir/hgcset.h"