Commit 8d6d0214 authored by Remi Perenon's avatar Remi Perenon

Fixing minor bug -'sedXXXXX' files creation-

parent 6e13df09
Pipeline #4470 passed with stages
in 24 minutes and 20 seconds
......@@ -7,7 +7,10 @@ rem To understand this syntax "set cmd=...... for /F %%ii ......", see https://s
rem Update the __pkginfo__ file with the current commit
echo "Commit id %MDANSE_GIT_CURRENT_COMMIT%"
echo "Branch name %MDANSE_GIT_BRANCH_NAME%"
sed -i "s/.*__commit__.*/__commit__ = \"%MDANSE_GIT_CURRENT_COMMIT%\"/" Src/__pkginfo__.py
rem sed -i unfortunately creates backup file, see https://stackoverflow.com/questions/1823591/sed-creates-un-deleteable-files-in-windows
rem so we do not use the -i option
sed "s/.*__commit__.*/__commit__ = \"%MDANSE_GIT_CURRENT_COMMIT%\"/" Src\\__pkginfo__.py >> Src\\__pkginfo__.pybak
move Src\\__pkginfo__.pybak Src\\__pkginfo__.py
rem Get MDANSE version
set cmd="sed -n "s/__version__.*=.*\"\(.*\)\"/\1/p" Src/__pkginfo__.py"
......@@ -16,14 +19,17 @@ for /F %%i in (' %cmd% ') do set MDANSE_VERSION=%%i
rem Check if branch is master, tag as draft otherwise
if "%MDANSE_GIT_BRANCH_NAME%" == "master" (
set VERSION_NAME=%MDANSE_VERSION%
sed -i "s/.*__beta__.*/__beta__ = None/" Src/__pkginfo__.py
sed "s/.*__beta__.*/__beta__ = None/" Src\\__pkginfo__.py >> Src\\__pkginfo__.pybak
move Src\\__pkginfo__.pybak Src\\__pkginfo__.py
) else (
rem Check if branch is release*
if "%MDANSE_GIT_BRANCH_NAME:~0,7%" == "release" (
set VERSION_NAME=%MDANSE_VERSION%-rc-%MDANSE_GIT_CURRENT_COMMIT%
sed -i "s/.*__beta__.*/__beta__ = \"rc\"/" Src/__pkginfo__.py
sed "s/.*__beta__.*/__beta__ = \"rc\"/" Src\\__pkginfo__.py >> Src\\__pkginfo__.pybak
move Src\\__pkginfo__.pybak Src\\__pkginfo__.py
) else (
set VERSION_NAME=%MDANSE_VERSION%-beta-%MDANSE_GIT_CURRENT_COMMIT%
sed -i "s/.*__beta__.*/__beta__ = \"beta\"/" Src/__pkginfo__.py
sed "s/.*__beta__.*/__beta__ = \"beta\"/" Src\\__pkginfo__.py >> Src\\__pkginfo__.pybak
move Src\\__pkginfo__.pybak Src\\__pkginfo__.py
)
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment