From 0c6837cfbdd0963903bf0463b05160c2aecc22ef Mon Sep 17 00:00:00 2001 From: Thomas Levine Date: Thu, 11 Oct 2012 15:47:08 -0400 Subject: [PATCH] blah --- ...ing like \"test\", no Molly-guard should be presented." | 3 +++ .../The -f flag should disable the Molly-guard. | 3 +++ ... it is run on something that does not look like a test. | 4 ++++ .../no molly guard if named test | 3 --- .../override | 3 --- .../warn on non-test | 3 --- urchin | 7 +++++-- 7 files changed, 15 insertions(+), 11 deletions(-) create mode 100755 "tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./If Urchin is run on a file named something like \"test\", no Molly-guard should be presented." create mode 100755 tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./The -f flag should disable the Molly-guard. create mode 100755 tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./Urchin should warn if it is run on something that does not look like a test. delete mode 100755 tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./no molly guard if named test delete mode 100755 tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./override delete mode 100755 tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./warn on non-test diff --git "a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./If Urchin is run on a file named something like \"test\", no Molly-guard should be presented." "b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./If Urchin is run on a file named something like \"test\", no Molly-guard should be presented." new file mode 100755 index 0000000..a17ed51 --- /dev/null +++ "b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./If Urchin is run on a file named something like \"test\", no Molly-guard should be presented." @@ -0,0 +1,3 @@ +#!/bin/sh + +../../urchin .test diff --git a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./The -f flag should disable the Molly-guard. b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./The -f flag should disable the Molly-guard. new file mode 100755 index 0000000..a085dd1 --- /dev/null +++ b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./The -f flag should disable the Molly-guard. @@ -0,0 +1,3 @@ +#!/bin/sh + +../../urchin -f .chainsaw diff --git a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./Urchin should warn if it is run on something that does not look like a test. b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./Urchin should warn if it is run on something that does not look like a test. new file mode 100755 index 0000000..9ad7510 --- /dev/null +++ b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./Urchin should warn if it is run on something that does not look like a test. @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir /tmp/urchintmp +! ../../urchin /tmp/urchintmp diff --git a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./no molly guard if named test b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./no molly guard if named test deleted file mode 100755 index 056090a..0000000 --- a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./no molly guard if named test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../urchin .test diff --git a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./override b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./override deleted file mode 100755 index f17b5f7..0000000 --- a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./override +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -../../../urchin -f .chainsaw diff --git a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./warn on non-test b/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./warn on non-test deleted file mode 100755 index 56fdf0e..0000000 --- a/tests/Urchin should do a sanity check so that directories like the user home are not specified as tests./warn on non-test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -! ../../../urchin /tmp/aoeuaoeuaoeuaoeu diff --git a/urchin b/urchin index 3dc3c42..07f54de 100755 --- a/urchin +++ b/urchin @@ -132,8 +132,11 @@ stdout_file=/tmp/urchin_stdout $HELP && urchin_help # Verify argument for main stuff -[ "$#" = '1' ] && [ -d "$1" ] || -( echo "$USAGE" && exit 1 ) +if [ "$#" != '1' ] && [ ! -d "$1" ] + then + echo "$USAGE" + exit 1 +fi # Run or present the Molly guard. if echo "$(basename "$(fullpath "$1")")" | grep test || $FORCE