From 95f1e4f03620c71ee39167c85d0671f313622667 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Tue, 4 Jun 2013 16:08:18 +0200 Subject: [PATCH] Rename project. --- bin/{koproj => kotam} | 22 ++++++++++---------- data/kotam.sample | 47 +++++++++++++++++++++++++++++++++++++++++++ koproj.sample | 47 ------------------------------------------- lib/base.sh | 6 +++--- 4 files changed, 61 insertions(+), 61 deletions(-) rename bin/{koproj => kotam} (54%) create mode 100755 data/kotam.sample delete mode 100755 koproj.sample diff --git a/bin/koproj b/bin/kotam similarity index 54% rename from bin/koproj rename to bin/kotam index 28ee831..5c1ddda 100755 --- a/bin/koproj +++ b/bin/kotam @@ -1,25 +1,25 @@ #!/bin/sh -KOPROJ_DATA_DIR=$(cd `dirname "$0"`; cd ../lib ; pwd ) -KOPROJ_CONFIG_DIR=$HOME/.config/koproj +KOTAM_DATA_DIR=$(cd `dirname "$0"`; cd ../lib ; pwd ) +KOTAM_CONFIG_DIR=$HOME/.config/kotam - . $KOPROJ_DATA_DIR/base.sh + . $KOTAM_DATA_DIR/base.sh ## Expected usage : # -# koproj exec -# koproj init +# kotam exec +# kotam init # -mkdir -p $KOPROJ_CONFIG_DIR +mkdir -p $KOTAM_CONFIG_DIR while [ $# -gt 0 ]; do arg=${1:-} opt=${2:-} case $arg in -l|--list) #list projects echo "List of projects :" - ls $KOPROJ_CONFIG_DIR/*.koproj 2> /dev/null + ls $KOTAM_CONFIG_DIR/*.kotam 2> /dev/null ;; -e) # edit project shift @@ -27,11 +27,11 @@ while [ $# -gt 0 ]; do if [ -z "$project" ]; then echo "ERROR: project name missing" >&2 exit 1 - elif [ ! -e "$KOPROJ_CONFIG_DIR/$project.koproj" ]; then + elif [ ! -e "$KOTAM_CONFIG_DIR/$project.kotam" ]; then echo "ERROR: unknown project $project" >&2 exit 1 fi - "$EDITOR" "$KOPROJ_CONFIG_DIR/$project.koproj" + "$EDITOR" "$KOTAM_CONFIG_DIR/$project.kotam" ;; -c) # create ;; @@ -39,11 +39,11 @@ while [ $# -gt 0 ]; do ;; *) #enter into project project="$arg" - if [ ! -e "$KOPROJ_CONFIG_DIR/$project.koproj" ]; then + if [ ! -e "$KOTAM_CONFIG_DIR/$project.kotam" ]; then echo "ERROR: unknown project $project" >&2 exit 1 fi - . "$KOPROJ_CONFIG_DIR/$project.koproj" + . "$KOTAM_CONFIG_DIR/$project.kotam" ;; esac shift diff --git a/data/kotam.sample b/data/kotam.sample new file mode 100755 index 0000000..da4b04f --- /dev/null +++ b/data/kotam.sample @@ -0,0 +1,47 @@ + +PROJECT_ROOT="/path/to/somewhere" +WPTHEME_PATH="$PROJECT_ROOT/wp-root" + +kotam_newtab +kotam_renametab "VAGRANT" +kotam_run "cd $PROJECT_ROOT" +kotam_run "clear" +kotam_run 'sudo /etc/init.d/vboxdrv start' +kotam_run './bin/vagrant up' + +kotam_newtab +kotam_renametab "VM" +kotam_run "cd $PROJECT_ROOT" +kotam_run "clear" + +kotam_newtab +kotam_renametab "FORGE" +kotam_run "cd $WPTHEME_PATH" +kotam_run "clear" +kotam_run "be forge watch" + +kotam_newtab +kotam_renametab "ASSETS" +kotam_run "cd $WPTHEME_PATH/source/assets" +kotam_run "clear" + +kotam_newtab +kotam_renametab "JS" +kotam_run "cd $WPTHEME_PATH/source/assets/javascripts" +kotam_run "clear" + +kotam_newtab +kotam_renametab "CSS" +kotam_run "cd $WPTHEME_PATH/source/assets/stylesheets" +kotam_run "clear" + +kotam_newtab +kotam_renametab "FUNCTIONS" +kotam_run "cd $WPTHEME_PATH/source/functions" +kotam_run "clear" + +kotam_newtab +kotam_renametab "TEMPLATES" +kotam_run "cd $WPTHEME_PATH/source/templates" +kotam_run "clear" + diff --git a/koproj.sample b/koproj.sample deleted file mode 100755 index 7ddae95..0000000 --- a/koproj.sample +++ /dev/null @@ -1,47 +0,0 @@ - -PROJECT_ROOT="/path/to/somewhere" -WPTHEME_PATH="$PROJECT_ROOT/wp-root" - -koproj_newtab -koproj_renametab "VAGRANT" -koproj_run "cd $PROJECT_ROOT" -koproj_run "clear" -koproj_run 'sudo /etc/init.d/vboxdrv start' -koproj_run './bin/vagrant up' - -koproj_newtab -koproj_renametab "VM" -koproj_run "cd $PROJECT_ROOT" -koproj_run "clear" - -koproj_newtab -koproj_renametab "FORGE" -koproj_run "cd $WPTHEME_PATH" -koproj_run "clear" -koproj_run "be forge watch" - -koproj_newtab -koproj_renametab "ASSETS" -koproj_run "cd $WPTHEME_PATH/source/assets" -koproj_run "clear" - -koproj_newtab -koproj_renametab "JS" -koproj_run "cd $WPTHEME_PATH/source/assets/javascripts" -koproj_run "clear" - -koproj_newtab -koproj_renametab "CSS" -koproj_run "cd $WPTHEME_PATH/source/assets/stylesheets" -koproj_run "clear" - -koproj_newtab -koproj_renametab "FUNCTIONS" -koproj_run "cd $WPTHEME_PATH/source/functions" -koproj_run "clear" - -koproj_newtab -koproj_renametab "TEMPLATES" -koproj_run "cd $WPTHEME_PATH/source/templates" -koproj_run "clear" - diff --git a/lib/base.sh b/lib/base.sh index 3396f25..570cf60 100644 --- a/lib/base.sh +++ b/lib/base.sh @@ -1,5 +1,5 @@ -koproj_run() { +kotam_run() { local cmd="$*" qdbus org.kde.konsole /Sessions/${session} sendText "$cmd" qdbus org.kde.konsole /Sessions/${session} sendText " @@ -7,14 +7,14 @@ koproj_run() { } -koproj_newtab() { +kotam_newtab() { #dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call \ # --print-reply /konsole/MainWindow_1 org.kde.KMainWindow.activateAction string:"new-tab" session=$(qdbus org.kde.konsole /Konsole newSession) } -koproj_renametab() { +kotam_renametab() { #sessionno=$1 tabname=$1 #session="/Sessions/${sessionno}"