Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wxnacy committed Aug 10, 2020
1 parent 55136d4 commit b24769c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions autoload/mysql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import vim
import commands
def run(env, sql):
cur_buf = vim.current.buffer
if 'prod' in str(cur_buf):
env = 'prod'

sql = sql.strip("'")
sql = sql.replace('`', '\`')
sql = sql.replace("'\''", "'")
sql = '{};'.format(sql)
cmd = 'mysql_run {} "{}"'.format(env, sql)
s, msg = commands.getstatusoutput(cmd)

Expand Down

0 comments on commit b24769c

Please sign in to comment.