[fenix] 40/127: Make a proper script for starting fenix programs

Peter Pentchev roam at ringlet.net
Thu Dec 17 14:39:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

roam-guest pushed a commit to branch master
in repository fenix.

commit 2d18210fb677737b78d6a2f7817fe69c5a48c399
Author: Miriam Ruiz <miriam at debian.org>
Date:   Thu Aug 2 10:15:53 2007 +0000

    Make a proper script for starting fenix programs
---
 debian/fenix.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/debian/fenix.sh b/debian/fenix.sh
index c9545ff..7450cd6 100755
--- a/debian/fenix.sh
+++ b/debian/fenix.sh
@@ -1,3 +1,72 @@
 #!/bin/sh
 
+# (c) 2007 Miriam Ruiz <little_miry at yahoo.es>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+ARG="$1"
+GAME_FILE=""
+
+if [ -z "$GAME_FILE" ] && [ -z "$ARG" ]; then
+	FILE_NUM=`ls *.prg 2>/dev/null | wc -l`
+	if [ "$FILE_NUM" -eq 1 ] ; then
+		GAME_FILE="ls *.prg 2>/dev/null"
+		echo "Game File: \"$GAME_FILE\"" >&2
+	else
+		GAME_FILE=""
+	fi
+fi
+
+if [ -z "$GAME_FILE" ] && [ -d "$ARG" ]; then
+	FILE_NUM=`ls "$ARG"/*.prg 2>/dev/null | wc -l`
+	if [ "$FILE_NUM" -eq 1 ] ; then
+		GAME_FILE="`ls "$ARG"/*.prg` 2>/dev/null"
+		echo "Game File: \"$GAME_FILE\"" >&2
+	else
+		GAME_FILE=""
+		echo "Cannot choose a game file in the directory \"$ARG\"" >&2
+		exit 1
+	fi
+fi
+
+if [ -e "$ARG" ]; then
+	FILE_NUM=`ls \"$ARG\" 2>/dev/null | wc -l`
+	if [ "$FILE_NUM" -eq 1 ] ; then
+		GAME_FILE=""
+		echo "Game File: \"$GAME_FILE\"" >&2
+	else
+		GAME_FILE="$ARG"
+		echo "Cannot choose a game file" >&2
+	fi
+fi
+
+if [ -z "$GAME_FILE" ] && [ ! -z "$ARG" ] && [ -z "$2" ]; then
+	echo "Game program does not exist in \"$ARG\"" >&2
+	exit 1
+fi
+
+if [ -z "$GAME_FILE" ] || [ ! -z "$2" ]; then
+	echo "Usage: $0" >&2
+	echo "Usage: $0 <file.prg>" >&2
+	echo "Usage: $0 <directory>" >&2
+	exit 1
+fi
+
+if [ -z "$GAME_FILE" ] || [ ! -e "$GAME_FILE" ]
+	echo "File \"$GAME_FILE\" does not exist" >&2
+	exit 1
+fi
+
 fenix-fxc "$@" -o - | fenix-fxi -

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/fenix.git



More information about the Pkg-games-commits mailing list