Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 28 lines (25 sloc) 1.081 kB
#!/usr/bin/env ruby
def replace_in_file(filepath, regexp, *args, &block)
content = File.read(filepath).gsub(regexp, *args, &block)
File.open(filepath, 'wb') { |file| file.write(content) }
end
file = File.expand_path(ARGV[0])
platform = ( File.extension(file) == ".plist" ? "ios" : "android" )
if (platform == "ios")
replace_in_file(file, /\s*<key>com.phonegap.facebook.Connect<\/key>\n/mi) do |match|
""
end
replace_in_file(file, /\s*<string>FacebookConnectPlugin<\/string>\n/mi) do |match|
""
end
replace_in_file(file, /<key>Plugins<\/key>\n\s*<dict>/mi) do |match|
"<key>Plugins</key>\n\t<dict>\n\t\t<key>com.phonegap.facebook.Connect</key>\n\t\t<string>FacebookConnectPlugin</string>"
end
elsif (platform == "android")
replace_in_file(file, /<plugin name="com.phonegap.facebook.Connect" value="com.phonegap.facebook.ConnectPlugin" \/>\n/mi) do |match|
""
end
replace_in_file(file, /\s*<\/plugins>/mi) do |match|
"\t<plugin name=\"com.phonegap.facebook.Connect\" value=\"com.phonegap.facebook.ConnectPlugin\" />\n</plugins>"
end
end
Jump to Line
Something went wrong with that request. Please try again.