diff options
author | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2015-06-17 13:00:29 -0300 |
---|---|---|
committer | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2015-06-17 13:00:29 -0300 |
commit | 83449f223ce59695bbd628abb0fb6c418a713c0f (patch) | |
tree | a1a297ea188b8c66e5ab54da8561bfcbffcf0255 | |
parent | f032ff7e5a00ed2d945a6fc2200c93919f88829d (diff) | |
download | luarocks-83449f223ce59695bbd628abb0fb6c418a713c0f.tar.gz luarocks-83449f223ce59695bbd628abb0fb6c418a713c0f.tar.bz2 luarocks-83449f223ce59695bbd628abb0fb6c418a713c0f.zip |
Checks if git is installed
When sources are to be fetched using git, check beforehand it is available
in the path instead of causing an error.
It will show the message:
`Error: 'git' program not found. Is git installed? You may want to edit variables.GIT`
and exit.
refs #381
-rw-r--r-- | src/luarocks/fetch/git.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua index 53fd4445..bea53fc8 100644 --- a/src/luarocks/fetch/git.lua +++ b/src/luarocks/fetch/git.lua | |||
@@ -40,6 +40,10 @@ function git.get_sources(rockspec, extract, dest_dir, depth) | |||
40 | -- Strip off .git from base name if present | 40 | -- Strip off .git from base name if present |
41 | module = module:gsub("%.git$", "") | 41 | module = module:gsub("%.git$", "") |
42 | 42 | ||
43 | if not fs.execute_quiet(git_cmd, "--version") then | ||
44 | return nil, "'"..git_cmd.."' program not found. Is git installed? You may want to edit variables.GIT" | ||
45 | end | ||
46 | |||
43 | local store_dir | 47 | local store_dir |
44 | if not dest_dir then | 48 | if not dest_dir then |
45 | store_dir = fs.make_temp_dir(name_version) | 49 | store_dir = fs.make_temp_dir(name_version) |