[gnome-icon-theme/auto-index-theme: 5/5] this isnt gonna work



commit f030ac21740487451ecf7a45c7f46fb9aa637eca
Author: Jakub Steiner <jimmac gmail com>
Date:   Tue Aug 25 23:49:30 2009 +0200

    this isnt gonna work

 build/index.theme.in |  305 --------------------------------------------------
 create-icon-theme.rb |   22 ++++-
 2 files changed, 21 insertions(+), 306 deletions(-)
---
diff --git a/create-icon-theme.rb b/create-icon-theme.rb
index 70382af..7e88810 100755
--- a/create-icon-theme.rb
+++ b/create-icon-theme.rb
@@ -1,5 +1,6 @@
 #!/usr/bin/env ruby
 require "fileutils"
+require "find"
 
 if (ARGV[0].nil?) #render all SVGs
   puts "Usage: #{$0} [icon theme directory]"
@@ -8,7 +9,8 @@ end
 
 THEME_NAME=ARGV[0]
 THEME_COMMENT="#{THEME_NAME} Icon Theme"
-OUTPUT="#{Dir.pwd}/output/#{THEME_NAME}"
+CWD=Dir.pwd
+OUTPUT="#{CWD}/output/#{THEME_NAME}"
 
 FileUtils.rm_rf OUTPUT
 FileUtils.mkdir_p OUTPUT
@@ -16,3 +18,21 @@ FileUtils.mkdir_p OUTPUT
 puts "Creating icon theme in #{OUTPUT}"
 puts "Copying build files.."
 FileUtils.cp_r Dir.glob("build/*"), OUTPUT
+
+#echo -e "[Icon Theme]\nName=$THEME_NAME\nComment=$THEME_COMMENT\n" > index.theme
+
+meta = File.new("#{OUTPUT}/index.theme.in","w+")
+meta.puts "[Icon Theme]\n_Name=#{THEME_NAME}\n_Comment=#{THEME_COMMENT}"
+meta.puts "Inherits=Tango,Oxygen"
+meta.print "Directories="
+#Dir.open(THEME_NAME).each do |path|
+
+Dir.chdir(THEME_NAME)
+Find.find(".") do |path|
+  if (File.directory?(path))
+    dir = path.gsub(/^\.\//,'')
+    meta.print "#{dir}," unless !dir.match('/')
+  end
+end
+
+meta.close



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]