Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a helper script for Bzlmod migration. #74

Merged
merged 4 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tools/add_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@
import sys
import time

from colorama import Fore, Style
from registry import Module
from registry import RegistryClient
from registry import log


YELLOW = "\x1b[33m"
RESET = "\x1b[0m"


def yes_or_no(question, default):
if default:
question += " [Y/n]: "
Expand All @@ -67,7 +70,7 @@ def yes_or_no(question, default):


def ask_input(msg):
return input(f"{Fore.YELLOW}ACTION: {Style.RESET_ALL}{msg}")
return input(f"{YELLOW}ACTION: {RESET}{msg}")


def from_user_input():
Expand Down Expand Up @@ -123,7 +126,8 @@ def from_user_input():
module.add_build_target(target)

if yes_or_no("Do you have a test module in your source archive?", True):
module.test_module_path = ask_input("Please enter the test module path in your source archive: ")
module.test_module_path = ask_input(
"Please enter the test module path in your source archive: ")
first = True
while not (module.test_module_build_targets or module.test_module_test_targets):
if not first:
Expand Down
Loading