This commit is contained in:
parent
2505128f8e
commit
759c9fa4a8
|
@ -10,8 +10,8 @@ _usage() {
|
|||
}
|
||||
|
||||
LAUNCH_EDIT=1
|
||||
if [[ $# -eq 2 ]]; then
|
||||
if [[ $1 -eq "-n" ]] || [[ $1 -eq "--no-edit" ]]; then
|
||||
if [ $# -eq 2 ]; then
|
||||
if [ "$1" -eq "-n" ] || [ "$1" -eq "--no-edit" ]; then
|
||||
LAUNCH_EDIT=0
|
||||
else
|
||||
_usage
|
||||
|
@ -19,11 +19,11 @@ if [[ $# -eq 2 ]]; then
|
|||
shift
|
||||
fi
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
if [ $# -ne 1 ]; then
|
||||
_usage
|
||||
fi
|
||||
|
||||
if [[ ! -f $1 ]]; then
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "$1: file not found"
|
||||
_usage
|
||||
fi
|
||||
|
@ -34,7 +34,13 @@ trap 'rm --force --recursive "${TMP_DIR}"' EXIT
|
|||
|
||||
|
||||
PO_EDITOR=poedit
|
||||
DIFFTOOL=$(git config diff.tool)
|
||||
DIFFTOOL=$(which $(git config diff.tool))
|
||||
|
||||
if [ ! -x "$DIFFTOOL" ]; then
|
||||
echo "git diff.tool seems not configured"
|
||||
_usage
|
||||
fi
|
||||
|
||||
PO_FILE=$1
|
||||
|
||||
# search for revs where fuzzy was added or suppressed
|
||||
|
@ -43,7 +49,7 @@ FUZZY_REVS=$(git log --oneline -S '#, fuzzy' ${PO_FILE} | \
|
|||
grep -i 'merge' | \
|
||||
awk '{ print $1 }')
|
||||
|
||||
if [[ ${LAUNCH_EDIT} -eq 1 ]]; then
|
||||
if [ ${LAUNCH_EDIT} -eq 1 ]; then
|
||||
${PO_EDITOR} "${PO_FILE}" 2>/dev/null &
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue