aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c>2009-04-25 23:08:15 +0000
committerhisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c>2009-04-25 23:08:15 +0000
commit9eb905efe2fdae188a5d6a17b979123ad524c7bc (patch)
tree5be49b3666123bf52f6c8ee5fe85233b0802b90a /src
parent08df24ac4f1ac5ef3b5bb59629e65e4b90b2a51d (diff)
downloadluarocks-9eb905efe2fdae188a5d6a17b979123ad524c7bc.tar.gz
luarocks-9eb905efe2fdae188a5d6a17b979123ad524c7bc.tar.bz2
luarocks-9eb905efe2fdae188a5d6a17b979123ad524c7bc.zip
cleanup
git-svn-id: http://luarocks.org/svn/luarocks/trunk@14 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/unix/tools.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua
index fdec7869..5d3afd5e 100644
--- a/src/luarocks/fs/unix/tools.lua
+++ b/src/luarocks/fs/unix/tools.lua
@@ -6,7 +6,7 @@ local fs = require("luarocks.fs")
6 6
7local cfg = require("luarocks.cfg") 7local cfg = require("luarocks.cfg")
8 8
9dir_stack = {} 9local dir_stack = {}
10 10
11--- Run the given command. 11--- Run the given command.
12-- The command is executed in the current directory in the dir stack. 12-- The command is executed in the current directory in the dir stack.
@@ -31,7 +31,7 @@ function current_dir()
31 current = pipe:read("*l") 31 current = pipe:read("*l")
32 pipe:close() 32 pipe:close()
33 end 33 end
34 for _, d in ipairs(fs.dir_stack) do 34 for _, d in ipairs(dir_stack) do
35 current = fs.absolute_name(d, current) 35 current = fs.absolute_name(d, current)
36 end 36 end
37 return current 37 return current
@@ -44,19 +44,19 @@ end
44-- @param d string: The directory to switch to. 44-- @param d string: The directory to switch to.
45function change_dir(d) 45function change_dir(d)
46 assert(type(d) == "string") 46 assert(type(d) == "string")
47 table.insert(fs.dir_stack, d) 47 table.insert(dir_stack, d)
48end 48end
49 49
50--- Change directory to root. 50--- Change directory to root.
51-- Allows leaving a directory (e.g. for deleting it) in 51-- Allows leaving a directory (e.g. for deleting it) in
52-- a crossplatform way. 52-- a crossplatform way.
53function change_dir_to_root() 53function change_dir_to_root()
54 table.insert(fs.dir_stack, "/") 54 table.insert(dir_stack, "/")
55end 55end
56 56
57--- Change working directory to the previous in the dir stack. 57--- Change working directory to the previous in the dir stack.
58function pop_dir() 58function pop_dir()
59 local d = table.remove(fs.dir_stack) 59 local d = table.remove(dir_stack)
60 return d ~= nil 60 return d ~= nil
61end 61end
62 62