Guest User

Untitled

a guest
Nov 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Generate list of arguments to pass to Sourcery
  4. function sourceryArguments {
  5. # Environment variables from BuildConfig to map into AppSecrets
  6. local arguments=(
  7. "CHAT_API_CLIENT_SECRET" "ANALYTICS_WRITE_KEY"
  8. )
  9. local combinedArgs
  10.  
  11. local argumentsIndices=${!arguments[*]}
  12. for index in $argumentsIndices
  13. do
  14. # Make the arguments list comma-separated
  15. if [ $index -gt 0 ];
  16. then
  17. combinedArgs="${combinedArgs},"
  18. fi
  19.  
  20. # Append the argument name and escaped argument value
  21. local argument=${arguments[$index]}
  22. local argumentName="${argument}"
  23. local argumentValue="\"${!argument}\""
  24. local argumentPair="${argumentName}=${argumentValue}"
  25. combinedArgs="${combinedArgs}${argumentPair}"
  26. done
  27. echo $combinedArgs
  28. }
  29.  
  30. sourceryArgs=$(sourceryArguments)
  31.  
  32. # Generate AppSecrets using the arguments list created above
  33. mkdir -p Generated/Sourcery
  34. Tools/Sourcery/bin/sourcery --sources ChatApp/Sources \
  35. --templates Templates/AppSecrets.stencil \
  36. --output Generated/Sourcery \
  37. --args $sourceryArgs
Add Comment
Please, Sign In to add comment