mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-19 19:04:23 +01:00
Merge branch 'develop'
This commit is contained in:
commit
e01fefb0b9
4 changed files with 12 additions and 14 deletions
2
Makefile
2
Makefile
|
@ -44,7 +44,6 @@ install-min: truncater
|
||||||
install "linklist.pl" "$(INSTALLDIR)/lib/ponysay/linklist.pl"
|
install "linklist.pl" "$(INSTALLDIR)/lib/ponysay/linklist.pl"
|
||||||
install "pq4ps" "$(INSTALLDIR)/lib/ponysay/pq4ps"
|
install "pq4ps" "$(INSTALLDIR)/lib/ponysay/pq4ps"
|
||||||
install "pq4ps.pl" "$(INSTALLDIR)/lib/ponysay/pq4ps.pl"
|
install "pq4ps.pl" "$(INSTALLDIR)/lib/ponysay/pq4ps.pl"
|
||||||
install "pq4ps-list" "$(INSTALLDIR)/lib/ponysay/pq4ps-list"
|
|
||||||
install "pq4ps-list.pl" "$(INSTALLDIR)/lib/ponysay/pq4ps-list.pl"
|
install "pq4ps-list.pl" "$(INSTALLDIR)/lib/ponysay/pq4ps-list.pl"
|
||||||
|
|
||||||
mkdir -p "$(INSTALLDIR)/share/licenses/ponysay/"
|
mkdir -p "$(INSTALLDIR)/share/licenses/ponysay/"
|
||||||
|
@ -130,6 +129,7 @@ uninstall-old:
|
||||||
if [ -d "$(INSTALLDIR)/share/ponies" ]; then rm -fr "$(INSTALLDIR)/share/ponies" ; fi
|
if [ -d "$(INSTALLDIR)/share/ponies" ]; then rm -fr "$(INSTALLDIR)/share/ponies" ; fi
|
||||||
if [ -d "$(INSTALLDIR)/share/ttyponies" ]; then rm -fr "$(INSTALLDIR)/share/ttyponies" ; fi
|
if [ -d "$(INSTALLDIR)/share/ttyponies" ]; then rm -fr "$(INSTALLDIR)/share/ttyponies" ; fi
|
||||||
if [ -f "$(INSTALLDIR)/bin/ponysaytruncater" ]; then unlink "$(INSTALLDIR)/bin/ponysaytruncater" ; fi
|
if [ -f "$(INSTALLDIR)/bin/ponysaytruncater" ]; then unlink "$(INSTALLDIR)/bin/ponysaytruncater" ; fi
|
||||||
|
if [ -d "$(INSTALLDIR)/lib/ponysay/pq4ps-list" ]; then unlink "$(INSTALLDIR)/lib/ponysay/pq4ps-list" ; fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
if [ -f "truncater" ]; then rm -f "truncater" ; fi
|
if [ -f "truncater" ]; then rm -f "truncater" ; fi
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../../../pq4ps-list
|
|
17
ponysay
17
ponysay
|
@ -15,8 +15,8 @@ HOMESHARE="${HOME}/.local/share/ponysay"
|
||||||
listcmd="$INSTALLDIR/lib/ponysay/list.pl"
|
listcmd="$INSTALLDIR/lib/ponysay/list.pl"
|
||||||
linklistcmd="$INSTALLDIR/lib/ponysay/linklist.pl"
|
linklistcmd="$INSTALLDIR/lib/ponysay/linklist.pl"
|
||||||
truncatercmd="$INSTALLDIR/lib/ponysay/truncater"
|
truncatercmd="$INSTALLDIR/lib/ponysay/truncater"
|
||||||
qlistcmd="$INSTALLDIR/lib/ponysay/pq4ps-list"
|
|
||||||
quotecmd="$INSTALLDIR/lib/ponysay/pq4ps"
|
quotecmd="$INSTALLDIR/lib/ponysay/pq4ps"
|
||||||
|
qlistcmd="$INSTALLDIR/lib/ponysay/pq4ps-list.pl"
|
||||||
|
|
||||||
pony="*" # Selected pony
|
pony="*" # Selected pony
|
||||||
wrap="" # Message wrap column
|
wrap="" # Message wrap column
|
||||||
|
@ -65,15 +65,20 @@ version() {
|
||||||
echo "ponysay v$VERSION"
|
echo "ponysay v$VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Marks ponies in lists that have quotes
|
||||||
|
qoutelist() {
|
||||||
|
bash -c "$("$qlistcmd" $("$quotecmd" --list))"
|
||||||
|
}
|
||||||
|
|
||||||
# Pony list function
|
# Pony list function
|
||||||
list() {
|
list() {
|
||||||
if [ -d $SYSTEMPONIES ]; then
|
if [ -d $SYSTEMPONIES ]; then
|
||||||
echo -e "\\e[01mponyfiles located in $SYSTEMPONIES:\\e[21m"
|
echo -e "\\e[01mponyfiles located in $SYSTEMPONIES:\\e[21m"
|
||||||
perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed -e 's/\.pony$//' | sort) | $qlistcmd
|
perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed -e 's/\.pony$//' | sort) | qoutelist
|
||||||
fi
|
fi
|
||||||
if [ -d $HOMEPONIES ]; then
|
if [ -d $HOMEPONIES ]; then
|
||||||
echo -e "\\e[01mponyfiles located in $HOMEPONIES:\\e[21m"
|
echo -e "\\e[01mponyfiles located in $HOMEPONIES:\\e[21m"
|
||||||
perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed -e 's/\.pony$//' | sort) | $qlistcmd
|
perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed -e 's/\.pony$//' | sort) | qoutelist
|
||||||
fi
|
fi
|
||||||
if [ ! -d $SYSTEMPONIES ] && [ ! -d $HOMEPONIES ]; then
|
if [ ! -d $SYSTEMPONIES ] && [ ! -d $HOMEPONIES ]; then
|
||||||
echo >&2 "All the ponies are missing! Call the Princess!"
|
echo >&2 "All the ponies are missing! Call the Princess!"
|
||||||
|
@ -88,9 +93,9 @@ _linklist() {
|
||||||
args=""
|
args=""
|
||||||
|
|
||||||
for file in $files; do
|
for file in $files; do
|
||||||
target=$(readlink $1"/"$file".pony")
|
target="$(readlink $1"/"$file".pony")"
|
||||||
|
|
||||||
if [ $target = "" ]; then
|
if [ "$target" = "" ]; then
|
||||||
target=$file
|
target=$file
|
||||||
else
|
else
|
||||||
target=$(echo $target | sed -e 's/^\.\///g' -e 's/\.pony$//g')
|
target=$(echo $target | sed -e 's/^\.\///g' -e 's/\.pony$//g')
|
||||||
|
@ -99,7 +104,7 @@ _linklist() {
|
||||||
args=$(echo $args $file $target)
|
args=$(echo $args $file $target)
|
||||||
done
|
done
|
||||||
|
|
||||||
perl $listcmd $scrw $(perl $linklistcmd $(echo $args) | sed -e 's/ /_/g') | sed -e 's/_/ /g' | $qlistcmd
|
perl $listcmd $scrw $(perl $linklistcmd $(echo $args) | sed -e 's/ /_/g') | sed -e 's/_/ /g' | qoutelist
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pony list function with symlink map, for both directories
|
# Pony list function with symlink map, for both directories
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cmd="$(echo "$0" | sed -e 's/\-list$//g')"
|
|
||||||
pl="$0.pl"
|
|
||||||
|
|
||||||
bash -c "$("$pl" $($cmd --list))"
|
|
Loading…
Reference in a new issue