Skip to content
Permalink
Browse files
Fixed switching to luarocks when lua version is changed
  • Loading branch information
DhavalKapil committed Jun 8, 2016
1 parent 8e79c0e commit 0cbad5d
Showing 1 changed file with 2 additions and 4 deletions.
6 luaver
@@ -402,7 +402,7 @@ __luaver_use_lua()
__luaver_print "Successfully switched to ${lua_name}"

# Checking whether luarocks is in use
if [ -L "luarocks" ]
if exists "luarocks"
then
# Checking if lua version of luarocks is consistent
__luaver_get_current_lua_version_short lua_version_1
@@ -412,9 +412,7 @@ __luaver_use_lua()
if [ $lua_version_1 != $lua_version_2 ]
then
__luaver_print "Luarocks in use is inconsistent with this lua version"
__luaver_exec_command "rm luarocks"
__luaver_exec_command "rm luarocks-admin"
__luaver___luaver_use_luarocks $luarocks_version
__luaver_use_luarocks $luarocks_version
fi
fi
}

2 comments on commit 0cbad5d

@rjpcomputing
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this when running the latest version of luaver:

$ luaver use 5.3.3
==>  Switching to lua-5.3.3
==>  Successfully switched to lua-5.3.3
bash: exists: command not found

So it doesn't seem fixed. Running on Debian Stable 8.4 x64.

@DhavalKapil
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, you are right, it should be fixed now.
74368c6
It should work now. Let me know if you face any other issue.

Please sign in to comment.