be6f0c90b8f7d56d812a0938cb2f6ef1a393c36c

Author
Fredrik Wallgren <fredrik.wallgren@gmail.com>
Committer
Fredrik Wallgren <fredrik.wallgren@gmail.com>
Date

Message

Update the script to account for the changes in 0.1.7 where .gas is a directory

Diff

 1diff --git a/plugins/gas/_gas b/plugins/gas/_gas
 2index befdc94598df69bba47201e6933829b4fb39fbce..23e6d99aa93bfe7a007f2c519e12153abc33025a 100644
 3--- a/plugins/gas/_gas
 4+++ b/plugins/gas/_gas
 5@@ -13,6 +13,7 @@ case $state in
 6 		cmds=(
 7             "version:Prints Gas's version"
 8             "use:Uses author"
 9+            "ssh:Creates a new ssh key for an existing gas author"
10             "show:Shows your current user"
11             "list:Lists your authors"
12             "import:Imports current user to gasconfig"
13@@ -25,8 +26,12 @@ case $state in
14 	args)
15 		case $line[1] in
16 			(use|delete)
17-				_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
18-				;;
19+        VERSION=$(gas -v)
20+        if [[ $VERSION == <1->.*.* ]] || [[ $VERSION == 0.<2->.* ]] || [[ $VERSION == 0.1.<6-> ]] then
21+          _values -S , 'authors' $(cat ~/.gas/gas.authors | sed -n -e 's/^.*\[\(.*\)\]/\1/p') && ret=0
22+        else
23+				  _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
24+        fi
25 		esac
26 		;;
27 esac