diff options
| author | Damien Regad <dregad@mantisbt.org> | 2020-12-17 20:33:34 +0100 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2020-12-17 20:33:34 +0100 |
| commit | 789a039f930a54431a1ed4db65a5df8679ba8d5a (patch) | |
| tree | f989e00d1241e1aaa6aac4d3c074a2cf10fc87a8 /scripts | |
| parent | 1bd18ee59e8fde815749ff4657fc3612a125d768 (diff) | |
| download | adodb-789a039f930a54431a1ed4db65a5df8679ba8d5a.tar.gz adodb-789a039f930a54431a1ed4db65a5df8679ba8d5a.tar.bz2 adodb-789a039f930a54431a1ed4db65a5df8679ba8d5a.zip | |
Replace 'git root' alias with native command
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/buildrelease.py | 3 | ||||
| -rwxr-xr-x | scripts/updateversion.py | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/scripts/buildrelease.py b/scripts/buildrelease.py index e151b5a2..cc477c9a 100755 --- a/scripts/buildrelease.py +++ b/scripts/buildrelease.py @@ -173,7 +173,8 @@ def main(): ) os.chdir(repo_path) else: - repo_path = subprocess.check_output('git root', shell=True).rstrip() + # Git repo's root directory + repo_path = updateversion.git_root() os.chdir(repo_path) # Check for any uncommitted changes diff --git a/scripts/updateversion.py b/scripts/updateversion.py index 23e2a072..61cde5e3 100755 --- a/scripts/updateversion.py +++ b/scripts/updateversion.py @@ -116,6 +116,13 @@ def get_release_date(version): return date.today().strftime("%d-%b-%Y") +def git_root(): + ''' Returns the git repository's root (top-level) directory + ''' + return subprocess.check_output('git rev-parse --show-toplevel', + shell=True).rstrip() + + def sed_script(version): ''' Builds sed script to update version information in source files ''' @@ -420,8 +427,10 @@ def main(): # Mandatory parameters version = version_check(args[0]) + # Change to Git repo's root directory + os.chdir(git_root()) + # Let's do it - os.chdir(subprocess.check_output('git root', shell=True).rstrip()) version_set(version, do_commit, do_tag) # end main() |
