Skip to content

Commit 071a6dc

Browse files
Add empty shell for remote subcommand
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent a0f57f9 commit 071a6dc

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

src/git_sim/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ def main(
260260
app.command()(git_sim.commands.pull)
261261
app.command()(git_sim.commands.push)
262262
app.command()(git_sim.commands.rebase)
263+
app.command()(git_sim.commands.remote)
263264
app.command()(git_sim.commands.reset)
264265
app.command()(git_sim.commands.restore)
265266
app.command()(git_sim.commands.revert)

src/git_sim/commands.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,26 @@ def rebase(
264264
handle_animations(scene=scene)
265265

266266

267+
def remote(
268+
action: str = typer.Argument(
269+
default=None,
270+
help="The action to perform for the remote",
271+
),
272+
remote: str = typer.Argument(
273+
default=None,
274+
help="The name of the remote",
275+
),
276+
url_or_path: str = typer.Argument(
277+
default=None,
278+
help="The url or path to the remote",
279+
),
280+
):
281+
from git_sim.remote import Remote
282+
283+
scene = Remote(action=action, remote=remote, url_or_path=url_or_path)
284+
handle_animations(scene=scene)
285+
286+
267287
def reset(
268288
commit: str = typer.Argument(
269289
default="HEAD",

src/git_sim/remote.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import sys
2+
import os
3+
import git
4+
import numpy
5+
import tempfile
6+
import shutil
7+
import stat
8+
import re
9+
10+
import manim as m
11+
12+
from typing import List
13+
from argparse import Namespace
14+
15+
from git.exc import GitCommandError, InvalidGitRepositoryError
16+
from git.repo import Repo
17+
18+
from git_sim.git_sim_base_command import GitSimBaseCommand
19+
from git_sim.settings import settings
20+
21+
22+
class Remote(GitSimBaseCommand):
23+
def __init__(self, action: str, remote: str, url_or_path: str):
24+
super().__init__()
25+
self.action = action
26+
self.remote = remote
27+
self.url_or_path = url_or_path
28+
self.cmd += f"{type(self).__name__.lower()} {self.action} {self.remote} {self.url_or_path}"
29+
30+
def construct(self):
31+
if not settings.stdout and not settings.output_only_path and not settings.quiet:
32+
print(f"{settings.INFO_STRING} {self.cmd}")
33+
34+
self.show_intro()
35+
#self.recenter_frame()
36+
#self.scale_frame()
37+
#self.add_details(repo_name)
38+
self.show_command_as_title()
39+
self.fadeout()
40+
self.show_outro()

0 commit comments

Comments
 (0)