aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-23 21:36:10 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-23 21:36:10 -0500
commitdd1240d13b8cb12f6fa1770704445d35e75447f9 (patch)
tree4f726d7a2c9594e81ad648eecfdbbf2099886812 /modules
parentf60369b2fee19c514c14b00938b2d5e860eaeebd (diff)
downloadtextadept-dd1240d13b8cb12f6fa1770704445d35e75447f9.tar.gz
textadept-dd1240d13b8cb12f6fa1770704445d35e75447f9.zip
Use lfs.chdir() instead of a command to do so; modules/textadept/run.lua
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/run.lua6
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