Tell the user when we have to switch from a deleted workspace

This commit is contained in:
James Lee 2012-03-08 14:08:38 -07:00
parent b79e79022a
commit 090674386f
1 changed files with 6 additions and 1 deletions

View File

@ -106,6 +106,7 @@ class Db
end
framework.db.workspace = workspace
elsif deleting and names
switched = false
# Delete workspaces
names.each do |name|
workspace = framework.db.find_workspace(name)
@ -117,12 +118,16 @@ class Db
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
if framework.db.workspace.name == workspace.name
framework.db.workspace = framework.db.default_workspace
switched = true
end
# now destroy the named workspace
workspace.destroy
print_status("Deleted workspace: #{name}")
end
end
print_status("Switched workspace: #{framework.db.workspace.name}") if switched
elsif renaming
if names.length != 2
print_error("Wrong number of arguments to rename")