Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 29 lines (22 sloc) 647 Bytes
#!/bin/bash
# Set up command recording wrapper
[ -z "$WRAPDIR" ] && WRAPDIR=/tmp/record-commands
[ -z "$WRAPPY_LOGPATH" ] &&
export WRAPPY_LOGPATH=/tmp/record-commands-log.txt
if [ $# -eq 0 ]
then
echo "Usage: record-commands command..."
echo "Then examine $WRAPPY_LOGPATH"
exit 1
fi
mkdir -p "$WRAPDIR" &&
ln -s $(which record-commands-wrapper) "$WRAPDIR" || exit 1
echo "$PATH" | sed 's/:/\n/g' | while read DIR
do
find "$DIR/" -maxdepth 1 -mindepth 1 | sed 's@.*/@@' | while read FILE
do
ln -s record-commands-wrapper "$WRAPDIR/$FILE" 2>/dev/null
done
done
OLDPATH="$PATH" PATH="$WRAPDIR:$PATH" "$@"
rm -rf "$WRAPDIR"
You can’t perform that action at this time.