def fetch(project) : working_dir = config['projects'][project]['repo_path'] if not os.path.exists(working_dir) : clone(project) res = 'empty' with path.cd( working_dir ) : res = process.get_output( [ "git", "fetch" ] ) return res
def branches(project) : working_dir = config['projects'][project]['repo_path'] if not os.path.exists(working_dir) : clone(project) result = [] with path.cd( working_dir ) : res = process.get_output( ["git", "branch", "-r"] ) brs = re.findall("origin/[\w\-]+", res) for x in brs : result.append(x[7:]) result.append('master') result.append('develop') return result
def clone(project) : with path.cd( config['projects'][project]['repo_path'] ) : out = process.get_output([ "git", "clone", config[ 'projects' ][ project ][ 'repo' ], "." ]) logger.write( out )
#!/usr/bin/python3 from process import get_output from pathlib import Path import glob s = str(Path("./vue-compiled/src/").resolve()) files = glob.glob("./vue-compiled/src/**/*.js.o", recursive=True) files = [Path(f).resolve() for f in files] d = {} for f in files: d[f] = get_output(f) for k, v in d.items(): print(str(k)[len(s) + 1:], ':', len(v))