Skip to content

Commit 6e0b3ab

Browse files
committed
%s
1 parent 7680201 commit 6e0b3ab

5 files changed

Lines changed: 43 additions & 7 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,6 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130

131-
token.txt
131+
token.txt
132+
133+
.idea

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli_main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import click
44
import argparse
55
from gitfun import GitFun as gf
6-
6+
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
77
@click.group(context_settings=CONTEXT_SETTINGS)
88
def cli():
99
pass
1010

1111
@cli.command()
12-
@click.option('-url', type=str, help='Length of password to be generated')
12+
@click.option('-url', type=str, help='Paste your link of the repo')
1313

14-
def fungit(url):
15-
click.echo(gf.remote(url))
14+
def initpush(url):
15+
click.echo(gf.init_push(url))

gitfun/GitFun.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
import subprocess
22

3+
4+
5+
def init_push(url:str) -> str:
6+
"""
7+
8+
:param url:str, required
9+
The url is passed to add a remote repo link for the git
10+
:return:
11+
str subprocess.run("git push --set-upstream origin master ")
12+
which pushes all the changes to repo
13+
"""
14+
15+
16+
commit_message = "initial Commit"
17+
subprocess.getoutput("git init")
18+
subprocess.getoutput("git remote add origin {0}").format(url)
19+
subprocess.getoutput("git add .")
20+
subprocess.getoutput("git commit -m %s")%(commit_message)
21+
return subprocess.getoutput("git push --set-upstream origin master ")
22+
23+
24+
25+
26+
27+
28+
29+
30+
331
def remote(url:str) -> str:
432
subprocess.run("git add remote origin",url)
5-
return "remote add"
33+
return "remote add"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
requirements = fh.read()
55
setup(
66
name = 'gitfun',
7-
version = '0.0.6',
7+
version = '0.0.112',
88
author = 'Shreeda Bhat',
99
author_email = 'shreeda@astaqc.com',
1010
url = "https://github.com/memetics19/gitfun.git",

0 commit comments

Comments
 (0)