Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 30 additions & 32 deletions bin/dep
Original file line number Diff line number Diff line change
Expand Up @@ -146,43 +146,41 @@ private
end
end

if __FILE__ == $0

Dep::CLI.file = File.join(Dir.pwd, ".gems")
Dep::CLI.prerelease = false
Dep::CLI.file = File.join(Dir.pwd, ".gems")
Dep::CLI.prerelease = false

on("-f") do |file|
Dep::CLI.file = file
end

on("--pre") do
Dep::CLI.prerelease = true
end
on("-f") do |file|
Dep::CLI.file = file
end

on("--help") do
IO.popen("less", "w") { |f| f.write(DATA.read) }
exit
end
on("--pre") do
Dep::CLI.prerelease = true
end

Dep::CLI.list = Dep::List.new(Dep::CLI.file)

FileUtils.touch(Dep::CLI.list.path) unless File.exist?(Dep::CLI.list.path)

case ARGV[0]
when "add"
Dep::CLI.add(ARGV[1])
when "rm"
Dep::CLI.rm(ARGV[1])
when "install", "i"
Dep::CLI.install
when nil
Dep::CLI.check
else
Dep::CLI.abort
end
on("--help") do
IO.popen("less", "w") { |f| f.write(DATA.read) }
exit
end

Dep::CLI.list = Dep::List.new(Dep::CLI.file)

FileUtils.touch(Dep::CLI.list.path) unless File.exist?(Dep::CLI.list.path)

case ARGV[0]
when "add"
Dep::CLI.add(ARGV[1])
when "rm"
Dep::CLI.rm(ARGV[1])
when "install", "i"
Dep::CLI.install
when nil, "check"
Dep::CLI.check
else
Dep::CLI.abort
end


__END__

DEP(1)
Expand All @@ -191,13 +189,13 @@ NAME
dep -- Basic dependency tracking

SYNOPSIS
dep
dep [check]
dep add libname [--pre]
dep rm libname
dep install

DESCRIPTION
dep
dep [check]
Checks that all dependencies are met.

dep add [gemname]
Expand Down