m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-22 23:49:47 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-22 23:49:47 +0200
commit044aeea322ee6069c4d281df1a28db2f126c2ac2 (patch)
tree243db4d4b42cb70c49d9bc9bd65b3dda2801ee28 /src
parentb9cc8f2f78283dfbf04de0891d67f5494d8f92f8 (diff)
Normalize negation and bashism.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 5e168c1..c8736e1 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -179,7 +179,7 @@ esac
if [[ -n $PASSWORD_STORE_KEY ]]; then
ID="$PASSWORD_STORE_KEY"
-elif ! [[ -f $ID ]]; then
+elif [[ ! -f $ID ]]; then
echo "You must run:"
echo " $program init your-gpg-id"
echo "before you may use the password store."
@@ -217,11 +217,11 @@ case "$command" in
tree --noreport "$PREFIX/$path" | tail -n +2 | sed 's/\(.*\)\.gpg$/\1/'
else
passfile="$PREFIX/$path.gpg"
- if ! [[ -f $passfile ]]; then
+ if [[ ! -f $passfile ]]; then
echo "$path is not in the password store."
exit 1
fi
- if [ $clip -eq 0 ]; then
+ if [[ $clip -eq 0 ]]; then
exec $GPG -d $GPG_OPTS "$passfile"
else
clip "$($GPG -d $GPG_OPTS "$passfile" | head -n 1)" "$path"
@@ -326,7 +326,7 @@ case "$command" in
fi
path="$1"
length="$2"
- if ! [[ $length =~ ^[0-9]+$ ]]; then
+ if [[ ! $length =~ ^[0-9]+$ ]]; then
echo "pass-length \"$length\" must be a number."
exit 1
fi
@@ -340,7 +340,7 @@ case "$command" in
$GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass"
git_add_file "$passfile" "Added generated password for $path to store."
- if [ $clip -eq 0 ]; then
+ if [[ $clip -eq 0 ]]; then
echo "The generated password to $path is:"
echo "$pass"
else
@@ -365,9 +365,9 @@ case "$command" in
path="$1"
passfile="$PREFIX/${path%/}"
- if ! [[ -d $passfile ]]; then
+ if [[ ! -d $passfile ]]; then
passfile="$PREFIX/$path.gpg"
- if ! [[ -f $passfile ]]; then
+ if [[ ! -f $passfile ]]; then
echo "$path is not in the password store."
exit 1
fi