Last active
November 19, 2020 10:42
-
-
Save cohen72/ca30b01a71fdecf057f429aa62b6d66b to your computer and use it in GitHub Desktop.
This file contains 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
def setup_env(unique_whitelabel_id) | |
ENV["UNIQUE_WHITELABEL_ID"] = unique_whitelabel_id | |
env_file = "./whitelabels/#{ENV["UNIQUE_WHITELABEL_ID"]}/.env" | |
assets = "./whitelabels/#{ENV["UNIQUE_WHITELABEL_ID"]}/assets/." | |
# ===== copy white label assets and env to root project | |
sh("cp #{env_file} ../") | |
sh("cp -a #{assets} ../src/assets/whitelabel") | |
# ===== load the env_file into the environment | |
Dotenv.overload env_file | |
# ====== ensure all necessary environment vars are setup | |
ensure_env_vars( | |
env_vars: %w[ | |
UNIQUE_WHITELABEL_ID | |
SPLASH_SCREEN_BG_COLOR | |
CITY_NAME | |
BUNDLE_IDENTIFIER | |
DEEPLINK_SCHEME | |
. | |
. | |
. | |
], | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment