#!/bin/sh if [ -d testdir ]; then testdir=testdir elif [ -d build/testdir ]; then testdir=build/testdir else echo "No testdir found" >&2 exit 0 fi tar -caf testdir.tar.xz $testdir