Skip to content

Instantly share code, notes, and snippets.

@cohen72
Last active November 19, 2020 10:42
Show Gist options
  • Save cohen72/ca30b01a71fdecf057f429aa62b6d66b to your computer and use it in GitHub Desktop.
Save cohen72/ca30b01a71fdecf057f429aa62b6d66b to your computer and use it in GitHub Desktop.
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