mirror of
https://github.com/zhigang1992/boxen.git
synced 2026-01-12 08:54:07 +08:00
Change --projects to not attempt to list installed ones in case of multiple dirs items are cloned to
This commit is contained in:
@@ -16,9 +16,5 @@ module Boxen
|
||||
@dir = dir
|
||||
@name = File.basename @dir
|
||||
end
|
||||
|
||||
def installed?
|
||||
File.directory? dir
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user