You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
371 B

#!/usr/bin/env ruby
require 'tempfile'
plist = ARGF.read
Tempfile.create('info.plist') do |f|
f << plist
f.flush
vars = `/usr/libexec/PlistBuddy -c "Print :variablesdontexport" #{f.path}`
vars = vars.split("\n")[1..-2].map(&:strip)
vars.each do |var|
`/usr/libexec/PlistBuddy -c "Set :variables:#{var} ''" #{f.path}`
end
f.rewind
puts f.read
end