mirror of
https://github.com/Dannecron/netology-devops.git
synced 2025-12-26 07:42:36 +03:00
homework 4.2: add questions 1-2, move homework to subdir
This commit is contained in:
13
src/homework/04-script/4.2/q2.py
Executable file
13
src/homework/04-script/4.2/q2.py
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/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)
|
||||
Reference in New Issue
Block a user