Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Created create new sub command #38

Open
wants to merge 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 23, 2013
  1. @jeffreyroberts
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 0 deletions.
  1. +23 −0 libexec/sub-new
View
23 libexec/sub-new
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# Usage: sub new [command name]
+# Summary: Create a new sub command
+# Help: This command is used to create a new sub command
+
+set -e
+
+if [ ! "$VISUAL" == "" ] || [ ! "$EDITOR" == "" ]; then
+ if [ ! "$VISUAL" == "" ]; then
+ EDITOR="$VISUAL"
+ elif [ ! "$EDITOR" == "" ]; then
+ EDITOR="$EDITOR"
+ fi
+else
+ EDITOR='vi'
+fi
+
+if [ $(echo $1 | wc -m) -gt 0 ]
+then
+ NEW_PATH=$_SUB_ROOT/libexec/sub-$1
+ $EDITOR $NEW_PATH
+ chmod a+x $NEW_PATH
+fi
Something went wrong with that request. Please try again.