-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCommon
68 lines (58 loc) · 1.33 KB
/
Common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
fastlane_require 'JSON'
#################
#################
##### CONST #####
#################
#################
@package_json_path = ''
#####################
#####################
##### FUNCTIONS #####
#####################
#####################
def debug_options(options, print)
# Prints out all options, useful for debugging w/ Jenkins
if print then
puts options.inspect
end
end
def copy_env_for_build_type(buildType)
# Copies env files to project root
# filename format: env.[buildType]
#
# example: $PROJECT_ROOT/env/env.release
dir = File.expand_path('..', Dir.pwd)
sh('cp', '%s/env/env.%s' % [dir, buildType], '%s/.env' % dir)
end
def handle_env_and_options(environment, options, isString=false, default=nil)
# Tristate selector - env vars, cli options, defaults
# Handles string and boolean types
output = nil
if isString == true
# Handle strings
if environment != nil
output = environment
elsif options != nil
output = options
elsif default != nil
output = default
else
output = nil
end
else
# Handle bools
if environment == true
output = true
elsif options == true
output = true
else
output = false
end
end
return output
end
#################
#################
##### LANES #####
#################
#################