def new(repo: str = typer.Option(Path.cwd().parts[-1], prompt="Repo name")): user = '******' pwd = os.environ['ENV_GTH'] s = """ curl -i -H Authorization: token {pwd} -d '{ "name": "monthly_report", "auto_init": true, "private": true }' https://api.github.com/{user}/repos """.format(pwd=pwd, user=user) console.print(s) # console.print(Path.cwd()) if False: repo_name = dict(name=repo) cmds = [] cmds.append('git init') cmds.append('curl -u \'' + usr + '\' https://api.github.com/user/repos -d \'{"name" : "' + repo + '"}\'') cmds.append(f'git remote add origin [email protected]:ab22375/{repo}.git') cmds.append('git add .') cmds.append('git commit -m "first commit"') cmds.append('git push --set-upstream origin master') for cmd in cmds: console.print(cmd)
def new(repo: str = typer.Option(Path.cwd().parts[-1], prompt="Repo name")): user = '******' pwd = os.environ['ENV_GTH'] s = f'curl -i -H "Authorization: token {pwd}"' s += " -d '{" s += f'"name": "{repo}",' # s += '"auto_init": true,' s += '"private": true' s += f"}}' https://api.github.com/{user}/repos" console.print(s) s = f'curl -i -H "Authorization: token {pwd}"' s += " -d '{" s += f'"name": "{repo}",' # s += '"auto_init": true,' s += '"private": true' s += f"}}' https://api.github.com/user/repos" if True: repo_name = dict(name=repo) cmds = [] cmds.append('git init') cmds.append(s) # cmds.append('curl -u \'' + usr + '\' https://api.github.com/user/repos -d \'{"name" : "' + repo + '"}\'') cmds.append(f'git remote add origin [email protected]:ab22375/{repo}.git') cmds.append('git add .') cmds.append('git commit -m "first commit"') cmds.append('git push --set-upstream origin master') for cmd in cmds: console.print(cmd)
def new(repo: str = typer.Option(Path.cwd().parts[-1], prompt="Repo name")): usr = '******' pwd = '57a361e49a3a8d12a7a73c6d8d79cf70c3da0425' repo_name = dict(name=repo) cmds = [] cmds.append('git init') cmds.append( 'curl -u {usr}:{pwd} https://api.github.com/user/repos -d \'{"name" : "' + repo + '"}\'') cmds.append(f'git remote add origin [email protected]:ab22375/{repo}.git') cmds.append('git add .') cmds.append('git commit -m "first commit"') cmds.append('git push --set-upstream origin master') for cmd in cmds: console.print(cmd)
def add(comment: str = typer.Option('upd', prompt="Comment: ")): cmds = [] cmds.append("git add .") cmds.append(f'git commit -m "{comment}" ') cmds.append("git push") for cmd in cmds: typer.echo(cmd) try: check_output(cmd, shell=True, cwd="./") #, cwd=folder) except: console.print('-' * 30, '\n\n ==>> Error\n\n', '-' * 30) console.print('*** END ***')
def new(repo: str = typer.Option(Path.cwd().parts[-1], prompt="Repo name")): # console.print(Path.cwd()) if True: usr = '******' pwd = os.environ['ENV_GTH'] repo_name = dict(name=repo) cmds = [] cmds.append('git init') cmds.append('curl -u \'' + usr + '\' https://api.github.com/user/repos -d \'{"name" : "' + repo + '"}\'') cmds.append(f'git remote add origin [email protected]:ab22375/{repo}.git') cmds.append('git add .') cmds.append('git commit -m "first commit"') cmds.append('git push --set-upstream origin master') for cmd in cmds: console.print(cmd)
def new( repo:str = typer.Option(Path.cwd().parts[-1], prompt="Repo name") ): user = '******' pwd = os.environ['ENV_GTH']
def new( repo:str = typer.Option(Path.cwd().parts[-1], prompt="Repo name") ): usr = '******' pwd = '57a361e49a3a8d12a7a73c6d8d79cf70c3da0425'
def new( repo:str = typer.Option('new-project', prompt="Repository name"), packages:str=typer.Option('', prompt="list of packages separated by space") ): console.print(Path.parent) pass
def new(repo: str = typer.Option(Path.cwd().parts[-1], prompt="Repo name")): console.print(repo) pass