Skip to content

Commit

Permalink
bump version number for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe GODOT committed May 15, 2023
1 parent 51236be commit c7251a4
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
5 changes: 5 additions & 0 deletions father.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
<compatibility>~10.0</compatibility>
<download_url>https://github.com/Probesys/glpi-plugins-father/releases/download/v1.4.1/father.tgz</download_url>
</version>
<version>
<num>1.4.2</num>
<compatibility>~10.0</compatibility>
<download_url>https://github.com/Probesys/glpi-plugins-father/releases/download/v1.4.2/father-1.4.2.tbz</download_url>
</version>
</versions>
<langs>
<lang>en_GB</lang>
Expand Down
94 changes: 94 additions & 0 deletions plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash
#
# -------------------------------------------------------------------------
# {NAME} plugin for GLPI
# Copyright (C) {YEAR} by the {NAME} Development Team.
# -------------------------------------------------------------------------
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# --------------------------------------------------------------------------
#

if [[ $# -ne 2 && $# -ne 3 ]]; then
echo $0: usage: plugin.sh name version [destination/path]
exit 1
fi

if [[ $# -eq 3 ]]; then
DIR=$3
if [ ! -d "$DIR" ]; then
echo "Destination directory $DIR does not exists!"
exit
fi
else
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
fi

NAME=$(echo $1|tr -dc '[[:alpha:]]')
LNAME=${NAME,,}
UNAME=${NAME^^}
VERSION=$2
YEAR=$(date +%Y)

DEST=$DIR/$LNAME
echo "Creating new $NAME plugin..."

if [ -d "$DEST" ]; then
echo "A directory named $LNAME already exists!"
exit 1
fi

mkdir $DEST

rsync \
--exclude '.git' \
--exclude 'plugin.sh' \
--exclude 'dist' \
--exclude 'README.md' \
-a . $DEST

pushd $DEST > /dev/null

#rename .tpl...
#for f in `ls *.tpl`
#do
# mv $f ${f%.*}
#done

# move xml file
mv plugin.xml $LNAME.xml

#do replacements
sed \
-e "s/{NAME}/$NAME/" \
-e "s/{LNAME}/$LNAME/" \
-e "s/{UNAME}/$UNAME/" \
-e "s/{VERSION}/$VERSION/" \
-e "s/{YEAR}/$YEAR/" \
-i setup.php hook.php $LNAME.xml

#generate archive and remove plugin folder after
cd .. &&
tar -cvjf $LNAME-$VERSION.tbz $LNAME &&
rm -rf $LNAME

popd > /dev/null
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// Version of the plugin
define('PLUGIN_FATHER_VERSION', '1.4.1');
define('PLUGIN_FATHER_VERSION', '1.4.2');
// Minimal GLPI version, inclusive
define('PLUGIN_FATHER_GLPI_MIN_VERSION', '10');
// Maximum GLPI version, exclusive
Expand Down

0 comments on commit c7251a4

Please sign in to comment.