This commit is contained in:
ahmadbilalkhalid 2019-09-16 17:30:53 +05:00
parent 4bd13f3d23
commit 041af6c34d

View file

@ -13,7 +13,10 @@ def cli():
@cli.command("setup") @cli.command("setup")
@click.option("--path", required=True) @click.option("--path", required=True)
@click.option("--api_server", required=True) @click.option("--api_server", required=True)
def setup(path, api_server): @click.option("--name", required=True)
@click.option("--realm", required=True)
@click.option("--seed", required=True)
def setup(path, api_server, name, realm, seed):
os.chdir(path) os.chdir(path)
repo_name = "ucloud-cli" repo_name = "ucloud-cli"
@ -26,6 +29,9 @@ def setup(path, api_server):
with open(os.path.join(repo_name, ".env"), "w") as f: with open(os.path.join(repo_name, ".env"), "w") as f:
content = ( content = (
f"UCLOUD_API_SERVER={api_server}\n" f"UCLOUD_API_SERVER={api_server}\n"
f"OTP_NAME={name}\n"
f"OTP_REALM={realm}\n"
f"OTP_SEED={seed}\n"
) )
f.writelines(content) f.writelines(content)