lib/discourse_theme/uploader.rb in discourse_theme-0.1.7 vs lib/discourse_theme/uploader.rb in discourse_theme-0.1.8

- old
+ new

@@ -14,10 +14,11 @@ sgz = Zlib::GzipWriter.new(File.open(gzip, 'wb')) tar = Archive::Tar::Minitar::Output.new(sgz) Dir.chdir(dir + "/../") do Find.find(File.basename(dir)) do |x| + Find.prune if File.basename(x) == "src" Find.prune if File.basename(x)[0] == ?. next if File.directory?(x) Minitar.pack_file(x, tar) end @@ -56,11 +57,11 @@ value: value }] } } - endpoint = + endpoint = if @is_theme_creator "/user_themes/#{@theme_id}" else "/admin/themes/#{@theme_id}?api_key=#{@api_key}" end @@ -87,10 +88,10 @@ def upload_full_theme filename = "#{Pathname.new(Dir.tmpdir).realpath}/bundle_#{SecureRandom.hex}.tar.gz" compress_dir(filename, @dir) - endpoint = + endpoint = if @is_theme_creator "/user_themes/import.json" else "/admin/themes/import.json?api_key=#{@api_key}" end