diff options
author | 2009-02-23 21:36:10 -0500 | |
---|---|---|
committer | 2009-02-23 21:36:10 -0500 | |
commit | dd1240d13b8cb12f6fa1770704445d35e75447f9 (patch) | |
tree | 4f726d7a2c9594e81ad648eecfdbbf2099886812 | |
parent | f60369b2fee19c514c14b00938b2d5e860eaeebd (diff) | |
download | textadept-dd1240d13b8cb12f6fa1770704445d35e75447f9.tar.gz textadept-dd1240d13b8cb12f6fa1770704445d35e75447f9.zip |
Use lfs.chdir() instead of a command to do so; modules/textadept/run.lua
-rw-r--r-- | modules/textadept/run.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index b8076ccf..c45d9019 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -25,10 +25,12 @@ function execute(command) ['%(filename)'] = filename, ['%(filename_noext)'] = filename_noext, }) - local chdir = string.format('cd "%s";\n', filedir) - local p = io.popen(chdir..command..' 2>&1') + local current_dir = lfs.currentdir() + lfs.chdir(filedir) + local p = io.popen(command..' 2>&1') local out = p:read('*all') p:close() + lfs.chdir(current_dir) textadept.print('> '..command..'\n'..out) buffer:goto_pos(buffer.length) end |