Exemplo n.º 1
0
    def __debug(command, dry=False):
        """
        This method will be called, if the debug mode
        is on.
        """
        if dry:
            command.append('--dry-run')
        Shell.debug(command)

        if dry:
            call(command)
        exit(1)
Exemplo n.º 2
0
    def __git_commit(git_tag):
        """
        Commit files to branch.
        The function call will return 0 if the command success.
        """
        Shell.msg('Commit changes.')
        if APISettings.DEBUG:
            Shell.debug('Execute "git commit" in dry mode.')
            if not call(['git', 'commit', '-m', '\'' + git_tag + '\'', '--dry-run']):
                pass
            return True

        if not call(['git', 'commit', '-m', '\'' + git_tag + '\'']):
            return True
        return False