Sha256: 8e9389630eb4745053130e48e55c29e8a511d394a960511f23ae3257130c2840

Contents?: true

Size: 414 Bytes

Versions: 9

Compression:

Stored size: 414 Bytes

Contents

# -*- encoding : utf-8 -*-

class MakeSymlinksRelative < Wagn::Migration
  def up
    Wagn.paths['files'].each do |file_path| 
      files = Dir.glob(File.join file_path, '**', '*')
      symlinks = files.select {|f| File.symlink? f }
      symlinks.each do |symlink|
        base = File.basename( File.readlink(symlink) )
        File.delete symlink
        File.symlink base, symlink
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wagn-1.14.9 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.8 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.7 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.6 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.5 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.4 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.3 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.2 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb
wagn-1.14.1 db/migrate_core_cards/20141119001955_make_symlinks_relative.rb