Created
June 26, 2015 07:59
-
-
Save gin0606/5f1621be3535823f789a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fastlane | |
module Actions | |
class BackupInfoPlistAction < Action | |
def self.run params | |
plist_path = params[:plist_path] | |
FileUtils.cp(plist_path, "#{plist_path}.back", {:preserve => true}) | |
end | |
def self.details | |
'This action backup your "Info.plist".' | |
end | |
def self.is_supported?(platform) | |
true | |
end | |
def self.author | |
"gin0606" | |
end | |
def self.available_options | |
[ | |
FastlaneCore::ConfigItem.new(key: :plist_path, | |
env_name: "", | |
description: "File name you want to back up", | |
optional: false), | |
] | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fastlane | |
module Actions | |
class RestoreInfoPlistAction < Action | |
def self.run params | |
plist_path = params[:plist_path] | |
backup_plist_path = "#{plist_path}.back" | |
raise "not exist #{backup_plist_path}" unless File.exist? backup_plist_path | |
FileUtils.cp(backup_plist_path, plist_path, {:preserve => true}) | |
FileUtils.rm(backup_plist_path) | |
end | |
def self.details | |
'This action restore your "Info.plist" that backuped in `backup_info_plist` action.' | |
end | |
def self.is_supported?(platform) | |
true | |
end | |
def self.author | |
"gin0606" | |
end | |
def self.available_options | |
[ | |
FastlaneCore::ConfigItem.new(key: :plist_path, | |
env_name: "", | |
description: "Original file name you want to restore", | |
optional: false), | |
] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment