Commit 06aafb73 authored by Vinnie Okada's avatar Vinnie Okada

Call chdir() with a block

parent abbea9a0
...@@ -11,10 +11,9 @@ module Backup ...@@ -11,10 +11,9 @@ module Backup
s[:tar_version] = tar_version s[:tar_version] = tar_version
tar_file = "#{s[:backup_created_at].to_i}_gitlab_backup.tar" tar_file = "#{s[:backup_created_at].to_i}_gitlab_backup.tar"
orig_pwd = Dir.pwd Dir.chdir(Gitlab.config.backup.path) do
Dir.chdir(Gitlab.config.backup.path) File.open("#{Gitlab.config.backup.path}/backup_information.yml",
"w+") do |file|
File.open("#{Gitlab.config.backup.path}/backup_information.yml", "w+") do |file|
file << s.to_yaml.gsub(/^---\n/,'') file << s.to_yaml.gsub(/^---\n/,'')
end end
...@@ -32,7 +31,7 @@ module Backup ...@@ -32,7 +31,7 @@ module Backup
File.umask(orig_umask) File.umask(orig_umask)
upload(tar_file) upload(tar_file)
Dir.chdir(orig_pwd) end
end end
def upload(tar_file) def upload(tar_file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment