diff --git a/install-discord-linux.rb b/install-discord-linux.rb index dda266d..cf6b749 100755 --- a/install-discord-linux.rb +++ b/install-discord-linux.rb @@ -170,7 +170,7 @@ class Installer file_contents = Net::HTTP.get(uri) output_file = "discord-#{version}.tar.gz" puts "download_installer: Output file will #{output_file}" - $CONFIG[:install_dir].chdir do + Dir.chdir($CONFIG[:install_dir]) do File.open(output_file, 'wb') do |file| file.write(file_contents) end @@ -181,7 +181,7 @@ class Installer def install installer_file = "discord-#{self.remote_version}.tar.gz" puts "do_install: Extracting new installer" - $CONFIG[:install_dir].chdir do + Dir.chdir($CONFIG[:install_dir]) do File.open(installer_file, 'rb') do |file| Gem::Package.new("").extract_tar_gz(file, $CONFIG[:install_dir]) end