Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
fix(versioning): move global var into config function
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed May 27, 2020
1 parent 6e59775 commit a2bfea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
12 changes: 4 additions & 8 deletions ispapibackorder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

$module_version = "4.0.0";

//if (!defined("WHMCS"))
// die("This file cannot be accessed directly");

Expand All @@ -24,15 +22,13 @@

function ispapibackorder_config()
{
global $module_version;
$configarray = array(
return [
"name" => "ISPAPI Backorder",
"description" => "This addon allows you to provide backorders to your customers.",
"version" => $module_version,
"author" => "HEXONET",
"language" => "english"
);
return $configarray;
"language" => "english",
"version" => "4.0.0"
];
}

function ispapibackorder_activate()
Expand Down
9 changes: 3 additions & 6 deletions updateVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

# version format: X.Y.Z
newversion="$1";
branch="$2";
date="$(date +'%Y-%m-%d')";

if [ "$branch" = "master" ]; then
sed -i "s/\$module_version = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\$module_version = \"${newversion}\"/g" ispapibackorder.php
sed -i "s/\"version\": \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\": \"${newversion}\"/g" release.json
sed -i "s/\"date\": \"[0-9]\+-[0-9]\+-[0-9]\+\"/\"date\": \"${date}\"/g" release.json
fi;
sed -i "s/\"version\" => \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\" => \"${newversion}\"/g" ispapibackorder.php
sed -i "s/\"version\": \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\": \"${newversion}\"/g" release.json
sed -i "s/\"date\": \"[0-9]\+-[0-9]\+-[0-9]\+\"/\"date\": \"${date}\"/g" release.json

0 comments on commit a2bfea1

Please sign in to comment.