diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-03 21:10:51 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-03 21:10:51 -0300 |
commit | 5996fea6e7d9c6963f98648ca5b7966b7f706008 (patch) | |
tree | 00bc0479f4a79794158c68b855f3e6d8a721ec78 /src | |
parent | a12de9fafa2d585621670d43216bd14626cb7c07 (diff) | |
download | luarocks-5996fea6e7d9c6963f98648ca5b7966b7f706008.tar.gz luarocks-5996fea6e7d9c6963f98648ca5b7966b7f706008.tar.bz2 luarocks-5996fea6e7d9c6963f98648ca5b7966b7f706008.zip |
fs.quiet doesn't require external tools
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fs/unix.lua | 7 | ||||
-rw-r--r-- | src/luarocks/fs/unix/tools.lua | 7 | ||||
-rw-r--r-- | src/luarocks/fs/win32.lua | 7 | ||||
-rw-r--r-- | src/luarocks/fs/win32/tools.lua | 7 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index 88bafaf6..e0d40970 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua | |||
@@ -15,6 +15,13 @@ local util = require("luarocks.util") | |||
15 | 15 | ||
16 | math.randomseed(os.time()) | 16 | math.randomseed(os.time()) |
17 | 17 | ||
18 | --- Annotate command string for quiet execution. | ||
19 | -- @param cmd string: A command-line string. | ||
20 | -- @return string: The command-line, with silencing annotation. | ||
21 | function quiet(cmd) | ||
22 | return cmd.." 1> /dev/null 2> /dev/null" | ||
23 | end | ||
24 | |||
18 | --- Return an absolute pathname from a potentially relative one. | 25 | --- Return an absolute pathname from a potentially relative one. |
19 | -- @param pathname string: pathname to convert. | 26 | -- @param pathname string: pathname to convert. |
20 | -- @param relative_to string or nil: path to prepend when making | 27 | -- @param relative_to string or nil: path to prepend when making |
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index 54120e91..3cee8a30 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua | |||
@@ -14,13 +14,6 @@ local function command_at(directory, cmd) | |||
14 | return "cd " .. fs.Q(directory) .. " && " .. cmd | 14 | return "cd " .. fs.Q(directory) .. " && " .. cmd |
15 | end | 15 | end |
16 | 16 | ||
17 | --- Annotate command string for quiet execution. | ||
18 | -- @param cmd string: A command-line string. | ||
19 | -- @return string: The command-line, with silencing annotation. | ||
20 | function quiet(cmd) | ||
21 | return cmd.." 1> /dev/null 2> /dev/null" | ||
22 | end | ||
23 | |||
24 | --- Obtain current directory. | 17 | --- Obtain current directory. |
25 | -- Uses the module's internal directory stack. | 18 | -- Uses the module's internal directory stack. |
26 | -- @return string: the absolute pathname of the current directory. | 19 | -- @return string: the absolute pathname of the current directory. |
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index 98daf13f..cbf5fc60 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua | |||
@@ -8,6 +8,13 @@ local fs = require("luarocks.fs") | |||
8 | local cfg = require("luarocks.cfg") | 8 | local cfg = require("luarocks.cfg") |
9 | local dir = require("luarocks.dir") | 9 | local dir = require("luarocks.dir") |
10 | 10 | ||
11 | --- Annotate command string for quiet execution. | ||
12 | -- @param cmd string: A command-line string. | ||
13 | -- @return string: The command-line, with silencing annotation. | ||
14 | function quiet(cmd) | ||
15 | return cmd.." 2> NUL 1> NUL" | ||
16 | end | ||
17 | |||
11 | --- Quote argument for shell processing. Fixes paths on Windows. | 18 | --- Quote argument for shell processing. Fixes paths on Windows. |
12 | -- Adds single quotes and escapes. | 19 | -- Adds single quotes and escapes. |
13 | -- @param arg string: Unquoted argument. | 20 | -- @param arg string: Unquoted argument. |
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index b250076a..48eca64b 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua | |||
@@ -32,13 +32,6 @@ local function command_at(directory, cmd) | |||
32 | return cmd | 32 | return cmd |
33 | end | 33 | end |
34 | 34 | ||
35 | --- Annotate command string for quiet execution. | ||
36 | -- @param cmd string: A command-line string. | ||
37 | -- @return string: The command-line, with silencing annotation. | ||
38 | function quiet(cmd) | ||
39 | return cmd.." 2> NUL 1> NUL" | ||
40 | end | ||
41 | |||
42 | --- Obtain current directory. | 35 | --- Obtain current directory. |
43 | -- Uses the module's internal directory stack. | 36 | -- Uses the module's internal directory stack. |
44 | -- @return string: the absolute pathname of the current directory. | 37 | -- @return string: the absolute pathname of the current directory. |