mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 10:30:52 +00:00
adds a line when no copyright for Dogecoin Core Developers exists but the file has been edited by us, to the last year found in git log, or extends the year range on an existing line when a file has been modified since the year previously listed. Excludes subtrees.
24 lines
699 B
Python
Executable File
24 lines
699 B
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright (c) 2021 The Bitcoin Core developers
|
|
# Copyright (c) 2023 The Dogecoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
'''
|
|
Common utility functions
|
|
'''
|
|
import shutil
|
|
import sys
|
|
import os
|
|
from typing import List
|
|
|
|
|
|
def determine_wellknown_cmd(envvar, progname) -> List[str]:
|
|
maybe_env = os.getenv(envvar)
|
|
maybe_which = shutil.which(progname)
|
|
if maybe_env:
|
|
return maybe_env.split(' ') # Well-known vars are often meant to be word-split
|
|
elif maybe_which:
|
|
return [ maybe_which ]
|
|
else:
|
|
sys.exit(f"{progname} not found")
|