Skip to content

Commit

Permalink
Fix: Adjust the release version string for the manual links
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Jun 10, 2022
1 parent ca25599 commit ac264b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/gmp/gmpsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {RELEASE_VERSION, REMOVED_ZERO_RELEASE_VERSION} from '../version';
import {RELEASE_VERSION} from '../version';

import {isDefined} from './utils/identity';

export const DEFAULT_RELOAD_INTERVAL = 15 * 1000; // fifteen seconds
export const DEFAULT_RELOAD_INTERVAL_ACTIVE = 3 * 1000; // three seconds
export const DEFAULT_RELOAD_INTERVAL_INACTIVE = 60 * 1000; // one minute
export const DEFAULT_MANUAL_URL = `http://docs.greenbone.net/GSM-Manual/gos-${REMOVED_ZERO_RELEASE_VERSION}/`;
export const DEFAULT_MANUAL_URL = `http://docs.greenbone.net/GSM-Manual/gos-${RELEASE_VERSION}/`;
export const DEFAULT_PROTOCOLDOC_URL = `https://docs.greenbone.net/API/GMP/gmp-${RELEASE_VERSION}.html`;
export const DEFAULT_REPORT_RESULTS_THRESHOLD = 25000;
export const DEFAULT_LOG_LEVEL = 'warn';
Expand Down
11 changes: 4 additions & 7 deletions src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@
const getMajorMinorVersion = () => {
// eslint-disable-next-line no-unused-vars
const [major, minor, ...rest] = VERSION.split('.');
minor = parseInt(minor)
if (minor < 10)
// add a leading zero for the links
minor = `0${minor}`
return `${major}.${minor}`;
};

const getCleanedMajorMinorVersion = () => {
// eslint-disable-next-line no-unused-vars
const [major, minor, ...rest] = VERSION.split('.');
return `${major}.${parseInt(minor)}`;
};

export const VERSION = '22.04.0.dev1';

export const RELEASE_VERSION = getMajorMinorVersion();
export const REMOVED_ZERO_RELEASE_VERSION = getCleanedMajorMinorVersion();

export default VERSION;

0 comments on commit ac264b2

Please sign in to comment.