mirror of
https://github.com/Dannecron/netology-devops.git
synced 2025-12-25 23:32:37 +03:00
14 lines
536 B
Python
Executable File
14 lines
536 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
cd_command = "cd ~/netology/sysadm-homeworks"
|
|
bash_command = [cd_command, "git status"]
|
|
top_level_command = [cd_command, "git rev-parse --show-toplevel"]
|
|
top_level = os.popen(' && '.join(top_level_command)).read().replace('\n', '')
|
|
result_os = os.popen(' && '.join(bash_command)).read()
|
|
for result in result_os.split('\n'):
|
|
if result.find('modified') != -1:
|
|
prepare_result = result.replace('\tmodified: ', '')
|
|
full_path = top_level + '/' + prepare_result
|
|
print(full_path)
|