Rename project.

This commit is contained in:
Glenn Y. Rolland 2013-06-04 16:08:18 +02:00
parent 56c57bbe88
commit 95f1e4f036
4 changed files with 61 additions and 61 deletions

View file

@ -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 <name>
# koproj init <name>
# kotam exec <name>
# kotam init <name>
#
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

47
data/kotam.sample Executable file
View file

@ -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"

View file

@ -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"

View file

@ -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}"