[DOCs] Added a mechanism to differentiate dev and master README

This commit is contained in:
Salvador E. Tropea 2022-10-12 13:16:56 -03:00
parent a0c125cc1b
commit 9c62b22a26
2 changed files with 22 additions and 0 deletions

View File

@ -7,6 +7,8 @@
[![PyPI version](https://img.shields.io/pypi/v/kibot?style=plastic)](https://pypi.org/project/kibot/)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?style=plastic)](https://www.paypal.com/donate/?hosted_button_id=K2T86GDTTMRPL)
@doc_id@
**Important for CI/CD**:
- We are now uploading docker images to GitHub, the new tags are much more simple.
Consult: [Usage for CI/CD](#usage-for-cicd)

View File

@ -9,6 +9,25 @@ $global_options=`../src/kibot --help-global-options`;
$dependencies=`../src/kibot --help-dependencies --markdown`;
$json_dep=`../src/kibot --help-dependencies --json`;
$json_dep=~s/\n/\\\n/g;
$branch=`git rev-parse --abbrev-ref HEAD`;
chomp($branch);
if ($branch eq "dev")
{
$doc_id="# **This is the documentation for the current development KiBot, not yet released.**\n";
}
else
{
open(FI, '../kibot/__init__.py');
while (<FI>)
{
if ($_ =~ /__version__\s+=\s+\'([^\']+)\'/)
{
$version = $1;
last;
}
}
$doc_id="# **This is the documentation for KiBot v$version for the current development read [here](https://github.com/INTI-CMNB/KiBot/tree/dev).**\n";
}
while (<>)
{
@ -20,6 +39,7 @@ while (<>)
$_ =~ s/\@global_options\@/$global_options/;
$_ =~ s/\@dependencies\@/$dependencies/;
$_ =~ s/\@json_dep\@/$json_dep/;
$_ =~ s/\@doc_id\@/$doc_id/;
print $_;
}