Change --projects to not attempt to list installed ones in case of multiple dirs items are cloned to

This commit is contained in:
Will Farrington
2013-02-06 20:52:38 -08:00
parent f1bd0e1f9a
commit ec171de46a
3 changed files with 3 additions and 13 deletions

View File

@@ -16,9 +16,5 @@ module Boxen
@dir = dir
@name = File.basename @dir
end
def installed?
File.directory? dir
end
end
end

View File

@@ -52,9 +52,10 @@ module Boxen
# --projects prints a list of available projects and exits.
if flags.projects?
puts "You can install any of these projects with `#{$0} <project-name>`:\n"
config.projects.each do |project|
prefix = project.installed? ? "*" : " "
puts "#{prefix} #{project.name}"
puts " #{project.name}"
end
exit

View File

@@ -7,13 +7,6 @@ class BoxenProjectTest < Boxen::Test
assert_equal "foo", project.dir
end
def test_installed?
project = Boxen::Project.new "foo"
File.expects(:directory?).with("foo").returns true
assert project.installed?
end
def test_name
project = Boxen::Project.new "foo/bar/baz"
assert_equal "baz", project.name