OSDN Git Service

Sort upload target on alphabetical order.
authorTatsuki Sugiura <sugi@nemui.org>
Wed, 16 Mar 2016 05:45:18 +0000 (14:45 +0900)
committerTatsuki Sugiura <sugi@nemui.org>
Wed, 16 Mar 2016 05:45:18 +0000 (14:45 +0900)
lib/osdn/cli/command/frs_upload.rb

index e9aaa54..868775b 100644 (file)
@@ -87,7 +87,7 @@ module OSDN; module CLI; module Command
       @target_dir = Pathname.new(ARGV.shift || '.')
       proj_info = api.get_project target_proj # check project existance
 
-      Pathname.glob(@target_dir+'*').each do |pdir|
+      Pathname.glob(@target_dir+'*').sort.each do |pdir|
         unless load_variables(pdir).package_id
           logger.info "Createing new package '#{pdir.basename}'"
           if @dry_run
@@ -99,7 +99,7 @@ module OSDN; module CLI; module Command
           $stdout.puts "New package '#{pinfo.name}' has been created; #{pinfo.url}"
         end
 
-        Pathname.glob(pdir + '*').each do |rdir|
+        Pathname.glob(pdir + '*').sort.each do |rdir|
           vars = load_variables(rdir)
           rinfo = nil
           if vars.release_id
@@ -115,7 +115,7 @@ module OSDN; module CLI; module Command
             $stdout.puts "New release '#{rinfo.name}' has been created; #{rinfo.url}"
           end
           
-          Pathname.glob(rdir + '*').each do |file|
+          Pathname.glob(rdir + '*').sort.each do |file|
             if file.directory?
               logger.error "Skip direcotry #{file}"
               next