Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Ruby: Apple Shake - Report FileIn Nodes (See related posts)

Another quick and dirty script I wrote when I screwed up my media's filesystem and I had to put it back together and this script simply prints out (nicely) the location of the files of every FileIn node in the Shake script.


#! /usr/bin/env ruby

$SOURCE = "" # Where are the Shake scripts?

$FILE_LIST = %x| ls #{$SOURCE}*.shk |.split("\n")

$FILE_LIST.each do |f|
  
  filein_nodes = File.open(f).grep(/SFileIn/)

  puts " --------- #{f} ------------"

  filein_nodes.map! { |n| n.split(/SFileIn/).last }

  filein_nodes.each { |n| puts n }
  
  puts "\n\n"

end


You need to create an account or log in to post comments to this site.


Related Posts