Exemplo n.º 1
0
def main():

    parser = make_parser()
    args = parser.parse_args()
    
    if args.area == "ioc" and args.domain_name:
        print("Modules in " + args.domain_name + ":\n")
        source = pathf.dev_module_path(args.domain_name, args.area)
    else:
        print("Modules in " + args.area + ":\n")
        source = pathf.dev_area_path(args.area)

    print_module_list(source)
Exemplo n.º 2
0
def main():

    parser = make_parser()
    args = parser.parse_args()

    if args.module_name == "":
        answer = raw_input("Would you like to checkout the whole " +
                           args.area + " area? This may take some time. Enter Y or N: ")
        if answer.upper() != "Y":
            return

    check_technical_area(args.area, args.module_name)

    module = args.module_name

    if module == "":
        # Set source to area folder
        source = pathf.dev_area_path(args.area)
    else:
        # Set source to module in area folder
        source = pathf.dev_module_path(module, args.area)

    if module == "":
        print("Checking out entire " + args.area + " area...\n")
        vcs_git.clone_multi(source)
    elif module.endswith('/') and args.area == 'ioc':
        print("Checking out " + module + " technical area...")
        vcs_git.clone_multi(source)
    else:
        print("Checking out " + module + " from " + args.area + " area...")
        repo = vcs_git.clone(source, module)

        if args.branch:
            # Get branches list
            branches = vcs_git.list_remote_branches(repo)
            if args.branch in branches:
                vcs_git.checkout_remote_branch(args.branch, repo)
            else:
                # Invalid branch name, print branches list and exit
                print("Branch '" + args.branch + "' does not exist in " + source +
                      "\nBranch List:\n")
                for entry in branches:
                    print(entry)