Class: Jumpstarter::Xcode::EditSchemeEnvVars

Inherits:
I_Instructions show all
Defined in:
lib/jumpstarter_core/xcode.rb

Instance Method Summary collapse

Methods inherited from I_Instructions

#clean_value, #compose!, #crash_on_error!, #error_message!, #initialize, #options, #success_message!

Constructor Details

This class inherits a constructor from Jumpstarter::I_Instructions

Instance Method Details

#run!Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/jumpstarter_core/xcode.rb', line 29

def run!()
    existing_scheme_path = @shared ? Xcodeproj::XCScheme.shared_data_dir(@proj_path) : Xcodeproj::XCScheme.user_data_dir(@proj_path)
    existing_scheme = "#{existing_scheme_path}/#{@scheme_name}.xcscheme"
    scheme = Xcodeproj::XCScheme.new(existing_scheme)
    environment_variables = scheme.launch_action.environment_variables
    environment_variables.assign_variable(:key => @key, :value => @value) 
    scheme.launch_action.environment_variables = environment_variables
    scheme.save!
    return true
end