Permalink
Browse files

merge jason v0.0.8 for bin/stub prepare

  • Loading branch information...
1 parent 9ad2597 commit 8071d6de46a34eb1258267bb11964c66094e5342 @defn defn committed Oct 6, 2012
Showing with 37 additions and 0 deletions.
  1. +37 −0 libexec/stub-prepare
View
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+#/ NAME
+#/ stub-prepare -- prepares a new stub
+#/
+#/ SYNOPSIS
+#/ stub prepare <new_command>
+
+# figure out the project root under which bin, lib live
+shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
+
+# load a jason bourne library
+source "$shome/bin/_treadstone"
+
+# parse the command-line
+
+# entry point
+function main {
+ if [[ "$#" = 0 ]]; then
+ logger_fatal "missing new command name"
+ exit 1
+ fi
+
+ local dollar='$'
+ local nm_command="$1"; shift
+
+ ln -vs stub "$shome/bin/$nm_command"
+ cat > "$shome/libexec/$nm_command" << EOF
+ echo arguments are ${dollar}@"
+EOF
+ chmod 755 "$shome/libexec/$nm_command"
+
+ logger_info "$nm_command is stubbed at bin/$nm_command"
+ logger_info "edit libexec/$nm_command for the actual script"
+}
+
+require 'sub' "$BASH_SOURCE" "$@"

0 comments on commit 8071d6d

Please sign in to comment.