# -*-coding:utf-8-*-
import os


class Shell:
    #commit&push project
    @staticmethod
    def push_project(config):
        command = "%s\n%s\n%s\n%s\n" \
            % (
                "cd "+config['root'],
                "git add .",
                "git commit -m \"%s\"" % (config['app_id'] +" " + config['version_name']),
                "git push origin %s" % config['git_branch']
            )
        os.system(command)

    #commit&push lib_base
    @staticmethod
    def push_base(config):
        commit_msg = input("输入commit msg:\n")
        command = "%s\n%s\n%s\n%s\n" \
            % (
                "cd %s/%s"%(config['root'],"lib_base"),
                "git add .",
                "git commit -m \"%s\"" % commit_msg,
                "git push origin master"
            )
        os.system(command)
