Skip to content

Commit e26420a

Browse files
committed
Bugfix
In some terminals the command `vagrant plugin list` does not output terminal escape sequences, breaking the '`vagrant up`. This commit fixes it.
1 parent f1fe67e commit e26420a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dependency_manager.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @Author: Dev_NIX
33
# @Date: 2016-03-07 14:24:11
44
# @Last Modified by: Dev_NIX
5-
# @Last Modified time: 2016-03-07 16:06:55
5+
# @Last Modified time: 2016-03-07 16:36:38
66

77
def check_plugins(dependencies)
88
installed_dependencies = []
@@ -13,7 +13,12 @@ def check_plugins(dependencies)
1313
raw_list = raw_output.split("\n")
1414

1515
raw_list.each do |plugin|
16-
installed_dependencies.push plugin.slice((plugin.index("\e[0m")+4)..(plugin.index("(")-1)).strip
16+
if plugin.index("\e[0m") != nil
17+
first = plugin.index("\e[0m") + 4
18+
else
19+
first = 0
20+
end
21+
installed_dependencies.push plugin.slice((first)..(plugin.index("(")-1)).strip
1722
end
1823

1924
no_missing = false

0 commit comments

Comments
 (0)