Skip to content

Commit

Permalink
#31: Add an ability to have multiple versions of the same plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
  • Loading branch information
Oleksandr Garagatyi committed Sep 20, 2018
1 parent dce1162 commit 9b4ded6
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions check_plugins_location.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,31 @@ for d in */ ; do
ID_DIR_NAME=${d%/}
cd $d

VERSION_DIR_NAME=$(ls -d */)
VERSION_DIR_NAME=${VERSION_DIR_NAME%/}
cd $VERSION_DIR_NAME
for VERSION_DIR_NAME in */ ; do
# Remove trailing slash
VERSION_DIR_NAME=${VERSION_DIR_NAME%/}
cd $VERSION_DIR_NAME

ID_YAML=$(yq r meta.yaml id | sed 's/^"\(.*\)"$/\1/')
if [[ "$ID_YAML" != "$ID_DIR_NAME" ]];then
echo "!!! ID mismatch in plugin '${ID_DIR_NAME}/${VERSION_DIR_NAME}':"
echo "!!! id in meta.yaml: '${ID_YAML}'"
echo "!!! id directory name: '${ID_DIR_NAME}' "
FOUND=true
fi
ID_YAML=$(yq r meta.yaml id | sed 's/^"\(.*\)"$/\1/')
if [[ "$ID_YAML" != "$ID_DIR_NAME" ]];then
echo "!!! ID mismatch in plugin '${ID_DIR_NAME}/${VERSION_DIR_NAME}':"
echo "!!! id in meta.yaml: '${ID_YAML}'"
echo "!!! id directory name: '${ID_DIR_NAME}' "
FOUND=true
fi

VERSION_YAML=$(yq r meta.yaml version | sed 's/^"\(.*\)"$/\1/')
if [[ "$VERSION_YAML" != "$VERSION_DIR_NAME" ]];then
echo "!!! Version mismatch in plugin '${ID_DIR_NAME}/${VERSION_DIR_NAME}':"
echo "!!! version in meta.yaml: '${VERSION_YAML}'"
echo "!!! version directory name: '${VERSION_DIR_NAME}' "
FOUND=true
fi
VERSION_YAML=$(yq r meta.yaml version | sed 's/^"\(.*\)"$/\1/')
if [[ "$VERSION_YAML" != "$VERSION_DIR_NAME" ]];then
echo "!!! Version mismatch in plugin '${ID_DIR_NAME}/${VERSION_DIR_NAME}':"
echo "!!! version in meta.yaml: '${VERSION_YAML}'"
echo "!!! version directory name: '${VERSION_DIR_NAME}' "
FOUND=true
fi

cd ../..
cd ..
done

cd ..
done

if [[ $FOUND ]];then
Expand Down

0 comments on commit 9b4ded6

Please sign in to comment.