lib/braid/commands/remove.rb in dreamcat4-braid-0.50 vs lib/braid/commands/remove.rb in dreamcat4-braid-0.52
- old
+ new
@@ -7,21 +7,28 @@
bail_on_local_changes!
with_reset_on_error do
msg "Removing mirror from '#{mirror.path}'."
- git.rm_r(mirror.path)
+ if mirror.type == "git-clone"
+ gitclone.remove_gitignore(mirror.path)
+ FileUtils.rm_rf(mirror.path)
+ config.remove(mirror)
+ add_config_file
+ else
+ git.rm_r(mirror.path)
- config.remove(mirror)
- add_config_file
+ config.remove(mirror)
+ add_config_file
- if options[:keep]
- msg "Not removing remote '#{mirror.remote}'" if verbose?
- elsif git.remote_url(mirror.remote)
- msg "Removed remote '#{mirror.path}'" if verbose?
- git.remote_rm mirror.remote
- else
- msg "Remote '#{mirror.remote}' not found, nothing to cleanup" if verbose?
+ if options[:keep]
+ msg "Not removing remote '#{mirror.remote}'" if verbose?
+ elsif git.remote_url(mirror.remote)
+ msg "Removed remote '#{mirror.path}'" if verbose?
+ git.remote_rm mirror.remote
+ else
+ msg "Remote '#{mirror.remote}' not found, nothing to cleanup" if verbose?
+ end
end
commit_message = "Removed mirror '#{mirror.path}'"
git.commit(commit_message)
msg commit_message