(self, vcs, command)
return command
check if user got wildcards or envvars in custom command
check if user got wildcards or envvars in custom command
check if user got wildcards or envvars in custom command
def expand_command(self, vcs, command):
        '''check if user got wildcards or envvars in custom command'''
        if any(c for c in '~*?[]$%' if c in command) and not isfile(command):
            match = glob.glob(os.path.expandvars(os.path.expanduser(command)))
            if match:
                return match[0]
            else:
                sublime.error_message(u'FileBrowser:\n'
                    u'It seems like you use wildcards in\n\n"%s_path": "%s".\n\n'
                    u'But the pattern cannot be found, please, fix it '
                    u'or use absolute path without wildcards.' % (vcs, command))
        return command
def expand_command ( self , vcs , command ) : if any ( c for c in '~*?[]$%' if c in command ) and not isfile ( command ) : match = glob . glob ( os . path . expandvars ( os . path . expanduser ( command ) ) ) if match : return match [ 0 ] else : sublime . error_message ( u'FileBrowser:\n' u'It seems like you use wildcards in\n\n"%s_path": "%s".\n\n' u'But the pattern cannot be found, please, fix it ' u'or use absolute path without wildcards.' % ( vcs , command ) ) return command