Example #1
0
def git_hash():
    current_working_folder = os.getcwd()
    os.chdir(path.root_dir)
    git_hash = subprocess.check_output(
        ['git', 'log', '-n', '1', '--pretty=%h']).split()[0]
    path.cd(current_working_folder)
    return git_hash
Example #2
0
def dev_version():
    current_working_folder = os.getcwd()
    try:
        os.chdir(path.root_dir)
        git_hash = subprocess.check_output(['git', 'log', '-n', '1', '--pretty=%h'], encoding='utf8').split()[0]
        path.cd(current_working_folder)
        return git_hash
    except:
        print("Ignore the git error above if you are building from a source code download instead of a git clone.")
        path.cd(current_working_folder)
        return "src"
Example #3
0
def dev_version():
    current_working_folder = os.getcwd()
    try:
        os.chdir(path.root_dir)
        git_hash = subprocess.check_output(['git', 'log', '-n', '1', '--pretty=%h']).split()[0]
        path.cd(current_working_folder)
        return git_hash
    except:
        print("Ignore the git error above if you are building from a source code download instead of a git clone.")
        path.cd(current_working_folder)
        return "src"
Example #4
0
def git_hash():
    current_working_folder = os.getcwd()
    os.chdir(path.root_dir)
    git_hash = subprocess.check_output(['git', 'log', '-n', '1', '--pretty=%h']).split()[0]
    path.cd(current_working_folder)
    return git_hash