#! /usr/bin/env bash

# file      : build/install/run-if-arg
# author    : Boris Kolpackov <boris@kolpackov.net>
# copyright : Copyright (c) 2004-2009 Boris Kolpackov
# license   : GNU GPL v2; see accompanying LICENSE file

# Run command if there are any non-empty arguments.
#
# $1 command to execute
# $2 argument to test

cmd=$1
shift

if [ "$*" ]; then
  exec $cmd $*
fi
