Permalink
Browse files

Add init command to create basic Carton file.

  • Loading branch information...
1 parent 43cb684 commit e54ffcff04ef4e3f987fd4fdf4ba98dd8c509ae8 @rejeep rejeep committed Jan 26, 2013
Showing with 32 additions and 7 deletions.
  1. +11 −7 bin/carton
  2. +10 −0 templates/init.tpl
  3. +11 −0 templates/usage.tpl
View
@@ -5,10 +5,11 @@ if [ -z "$EMACS" ] || [ -z "`which $EMACS`" ] ; then
fi
if [ -z "$CARTON_DIR" -o ! -d "$CARTON_DIR" ] ; then
- CARTON_DIR=$(dirname $(dirname $BASH_SOURCE))
+ CARTON_DIR="$(dirname $(dirname $BASH_SOURCE))"
fi
-
-CARTON_EL=$CARTON_DIR/carton.el
+TEMPLATE_DIR="$CARTON_DIR/templates"
+
+CARTON_EL="$CARTON_DIR/carton.el"
if [[ $# -eq 0 ]]; then
COMMAND=install
@@ -22,10 +23,13 @@ else
elif [[ $1 == "exec" ]]; then
EMACSLOADPATH=$($EMACS -Q --batch --eval '(message (mapconcat (quote identity) (append (file-expand-wildcards "elpa/*" t) load-path) ":"))' 2>&1) exec "${@:2}"
else
- echo "Could not find task '$1'."
- echo "usage: carton [INSTALL]"
- echo " carton package"
- echo " carton exec [COMMAND]"
+ if [[ $1 == "init" ]]; then
+ cat $TEMPLATE_DIR/init.tpl > Carton
+ elif [ "$1" == "-h" -o "$1" == "--help" ]; then
+ cat $TEMPLATE_DIR/usage.tpl
+ else
+ cat $TEMPLATE_DIR/usage.tpl
+ fi
exit 1
fi
View
@@ -0,0 +1,10 @@
+(source "melpa" "http://melpa.milkbox.net/packages/")
+
+(package "" "0.0.1" "")
+
+(depends-on "s" "1.3.0")
+(depends-on "dash" "1.0.3")
+
+(development
+ (depends-on "ecukes")
+ (depends-on "espuds"))
View
@@ -0,0 +1,11 @@
+USAGE: carton [command]
+
+COMMANDS:
+ package Create -pkg.el file
+ install Install dependencies
+ update Update dependencies
+ exec Execute command with correct dependencies
+ init Create basic Carton file
+
+OPTIONS:
+ -h, --help Display this help message

0 comments on commit e54ffcf

Please sign in to comment.