allow the default workspace to be purged and recreated

git-svn-id: file:///home/svn/framework3/trunk@8134 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-01-15 15:58:13 +00:00
parent 2ba892aa69
commit b6b25b7f03
1 changed files with 3 additions and 1 deletions

View File

@ -97,7 +97,9 @@ class Db
if workspace.nil?
print_error("Workspace not found: #{name}")
elsif workspace.default?
print_error("Can't delete default workspace")
workspace.destroy
workspace = framework.db.add_workspace(name)
print_status("Deleted and recreated the default workspace")
else
# switch to the default workspace if we're about to delete the current one
framework.db.workspace = framework.db.default_workspace if framework.db.workspace.name == workspace.name