create lab directory in parent

abstract MazeParams to be able to set them easily
doit.sh support new class creation
updated README

Signed-off-by: philippe lhardy <philippe@pavilionartlogiciel>
This commit is contained in:
philippe lhardy
2015-02-18 21:06:37 +01:00
parent 894e5c7970
commit 7d8ce42c15
5 changed files with 151 additions and 23 deletions

34
doit.sh
View File

@@ -1,5 +1,19 @@
#!/bin/bash
setup()
{
if [[ ! -d java ]]
then
echo "[FATAL] this tools $0 is intended to be run within laby project. Missing java directory." >&2
exit 1
fi
if [[ ! -d lab ]]
then
echo "[INFO] Creating directory lab to save default lab created"
mkdir lab
fi
}
do_code()
{
background=$1
@@ -127,15 +141,17 @@ done
if [[ -z $DIALOG ]]
then
echo "no console gui support (within $possible_console_gui) => no menus "
echo "[ERROR] no console gui support (no dialog tool found within $possible_console_gui) => no menus " >&2
exit 1
fi
setup
action=initial
while [[ $action != quit ]]
do
action=$($DIALOG --menu "Ultra Light IDE" 20 80 12 run "Run it" clean "Clean All" ant "Ant build" test "Test it" readme "Read me" code "Code" codebg "Code in background" deb "Debian package" properties "Edit Properties" quit "Quit" 3>&1 1>&2 2>&3)
action=$($DIALOG --menu "Ultra Light IDE" 20 80 12 run "Run it" clean "Clean All" ant "Ant build" test "Test it" readme "Read me" code "Code" codebg "Code in background" deb "Debian package" properties "Edit Properties" create "Create a new class" quit "Quit" 3>&1 1>&2 2>&3)
if [[ $action == run ]]
then
@@ -166,9 +182,21 @@ do
do_code $action
elif [[ $action == readme ]]
then
$DIALOG --textbox README 20 80
$DIALOG --textbox README 40 80 --scrolltext
elif [[ $action == properties ]]
then
edit_properties project_params
elif [[ $action == create ]]
then
newclass=$($DIALOG --inputbox "Enter new class name" 10 80 "NewClass" 3>&1 1>&2 2>&3)
if [[ $? = 0 ]]
then
if [[ -n $newclass ]]
then
pushd java
make work/$newclass
popd
fi
fi
fi
done