lib/subtrac.rb in ktec-subtrac-0.1.56 vs lib/subtrac.rb in ktec-subtrac-0.1.57
- old
+ new
@@ -114,9 +114,53 @@
# store any user preferences for later use
Config.save()
end
+
+ def delete_project(project,client)
+
+ load_config()
+
+ if client
+ # test the client exists
+ client_exists = Dir.exist?(File.join(Config.svn_dir,client))
+ end
+
+ unless client or client_exists
+ list_of_clients = Dir.entries(Config.svn_dir)
+ choose do |menu|
+ menu.prompt = "Which client contains the project you would like to delete? "
+ list_of_clients.each do |t|
+ unless File.directory?(t)
+ menu.choice t do client = t end
+ end
+ end
+ end
+ end
+
+ if project
+ # test the project exists
+ project_exists = Dir.exist?(File.join(Config.svn_dir,client,project))
+ end
+
+ unless project or project_exists
+ list_of_projects = Dir.entries(File.join(Config.svn_dir,client))
+ choose do |menu|
+ menu.prompt = "Which client contains the project you would like to delete? "
+ list_of_projects.each do |t|
+ unless File.directory?(t)
+ menu.choice t do project = t end
+ end
+ end
+ end
+ end
+
+ # remove the folder
+ puts "Dir.delete(" + File.join(Config.svn_dir,client,project) + ")"
+
+ end
+
def create_project(project,client,template=nil)
load_config()