Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
fix issue #10, MPATH with leading "./" are now working
Browse files Browse the repository at this point in the history
  • Loading branch information
larseidam committed Feb 28, 2012
1 parent fd77896 commit 26a98fd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions application/tests/CodeSniffer/cs-scripts.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,23 @@ function cs-disable() {
# on a submodule
function cs-install-submodule() {
return_value=0

# check if last letter is an "/", if not add a "/" at the end
LASTLETTER=${1: -1}
if [[ $LASTLETTER != "/" ]]
then
MPATH=$1/
else
MPATH=$1
fi

# check if first letters are "./", if so cut this letters
FIRSTLETTERS=${MPATH: 0: 2}
if [[ $FIRSTLETTERS == "./" ]]
then
MPATH=${MPATH: 2}
fi

BACKMPATH=${MPATH//[^\/]}
BACKMPATH=${BACKMPATH//\//..\/}
cs-install;
Expand All @@ -111,13 +121,23 @@ function cs-install-submodule() {
# on a submodule
function cs-uninstall-submodule() {
return_value=0

# check if last letter is an "/", if not add a "/" at the end
LASTLETTER=${1: -1}
if [[ $LASTLETTER != "/" ]]
then
MPATH=$1/
else
MPATH=$1
fi

# check if first letters are "./", if so cut this letters
FIRSTLETTERS=${MPATH: 0: 2}
if [[ $FIRSTLETTERS == "./" ]]
then
MPATH=${MPATH: 2}
fi

echo -n " Do you really want to uninstall CodeSniffer for Submodule '$MPATH'? (y/n): "
read CONFIRM;
if [[ $CONFIRM == "y" ]]
Expand Down

0 comments on commit 26a98fd

Please sign in to comment.