Exemple #1
0
    def run_wizard(self):
        #UI.print('Git.run_wizard()')
        # get repo name
        if not UI.ask_boolean("Is the name of the repo: {}?".format(
                self.repo_id)):
            self.repo_id = UI.ask("What is the name of the repo?")
        # check if folder is already a repo
        if self.is_git_repo():
            print('this is a git repo')
        else:
            # todo - check to see if thise repo exists on github first
            # note - had errors running this script due to the fact that the directory was not empty
            clone_cmd = 'git clone https://github.com/keithritt/{repo_id}.git {repo_dir}'.format(
                repo_id=self.repo_id, repo_dir=self.repo_dir)

            output = UI.run(cmd=clone_cmd, cwd='/home/ubuntu/')
            #todo - add logic to parse if response was an error
            print('output = {}'.format(output))

        self.current_branch = self.get_checked_out_branch()
        #print(branch)
        if self.env == 'dev' and self.current_branch != 'dev':
            #print('we need to check out the dev branch')
            if not self.does_branch_exist('dev'):
                self.create_branch('dev')

            self.checkout_branch('dev')

        if not self.is_upstream_set():
            self.set_upstream()
Exemple #2
0
 def prompt_for_domain_code(self):
     default = self.get_default_domain_code()
     if UI.ask_boolean(
             'Would you like to use {} as your domain code?'.format(
                 default)):
         self.domain_code = default
     else:
         self.domain_code = UI.ask(
             'What would you like to use for your domain code?')