mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-02 05:52:18 +00:00
8972d9773e
- Simplify build/version updates by moving MARKETING_VERSION and CURRENT_PROJECT_VERSION to Config.xcconfig - Provide Ruby (for fastlane) and Bash (for CI) versions of xconfig-get/set - Copy release notes atomically inside the lane to guarantee they are included in the version commit - Add -nt to skip the build tag
24 lines
534 B
Ruby
24 lines
534 B
Ruby
def xcconfig_set(path, key, value)
|
|
unless File.exist?(path)
|
|
raise "File not found: #{path}"
|
|
end
|
|
content = File.read(path)
|
|
pattern = /^(#{key}) = .*$/
|
|
replacement = "\\1 = #{value}"
|
|
modified_content = content.gsub(pattern, replacement)
|
|
File.write(path, modified_content)
|
|
end
|
|
|
|
def xcconfig_get(path, key)
|
|
unless File.exist?(path)
|
|
raise "File not found: #{path}"
|
|
end
|
|
pattern = /^#{key} = (.*)$/
|
|
File.foreach(path) do |line|
|
|
if (match = line.match(pattern))
|
|
return match[1]
|
|
end
|
|
end
|
|
nil
|
|
end
|