refactor: move submodule status logic in push_code function
This commit is contained in:
parent
10bd144b6e
commit
5990ada146
@ -210,18 +210,7 @@ async def push_code():
|
|||||||
os.chdir(project_path)
|
os.chdir(project_path)
|
||||||
print(f"Changed to project path: {project_path}")
|
print(f"Changed to project path: {project_path}")
|
||||||
|
|
||||||
# Get submodule information
|
|
||||||
submodule_diffs = {}
|
|
||||||
if await has_submodules():
|
|
||||||
submodule_info = await get_submodule_info()
|
|
||||||
for path in submodule_info:
|
|
||||||
submodule_diffs[path] = get_git_diff(path)
|
|
||||||
|
|
||||||
# Format and print the tree output
|
|
||||||
tree_output = format_tree_output(project_path, submodule_diffs)
|
|
||||||
print("\nProject Status:")
|
|
||||||
print(tree_output)
|
|
||||||
print()
|
|
||||||
|
|
||||||
# Rest of the push_code function remains the same
|
# Rest of the push_code function remains the same
|
||||||
proc = await asyncio.create_subprocess_exec(
|
proc = await asyncio.create_subprocess_exec(
|
||||||
@ -261,6 +250,17 @@ async def push_code():
|
|||||||
elif stderr:
|
elif stderr:
|
||||||
# Not an error; just info output
|
# Not an error; just info output
|
||||||
print(stderr.decode())
|
print(stderr.decode())
|
||||||
|
submodule_diffs = {}
|
||||||
|
if await has_submodules():
|
||||||
|
submodule_info = await get_submodule_info()
|
||||||
|
for path in submodule_info:
|
||||||
|
submodule_diffs[path] = get_git_diff(path)
|
||||||
|
|
||||||
|
# Format and print the tree output
|
||||||
|
tree_output = format_tree_output(project_path, submodule_diffs)
|
||||||
|
print("\nProject Status:")
|
||||||
|
print(tree_output)
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user