Advertisement
Guest User

Untitled

a guest
Jul 29th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```
  2. genFeatureSetFromGroup :: Text -> Text -> Service.ContextField -> Haxl ()
  3. genFeatureSetFromGroup teamName groupName cf =
  4.   do
  5.     templatePath <- H.io $ getPathInSigma
  6.       "FeatureSets/FeatureStore/FeatureSetFromGroupTemplate.txt"
  7.     template <- H.io $ TextIO.readFile templatePath
  8.  
  9.     -- Write to FeatureSet file
  10.     featureSetFilePath <- H.io $ getPathInSigma $
  11.       "FeatureSets/Generated" </> Text.unpack fileName
  12.     H.io $ TextIO.writeFile featureSetFilePath $ fillContents template
  13.     H.io $ print $ "Created FeatureSet: " <> fileName
  14.   where
  15.     fillContents contents =
  16.       contents
  17.       & Text.replace "<MODULE_NAME>" moduleName
  18.       & Text.replace "<FEATURE_SET_NAME>" featureSetName
  19.       & Text.replace "<FEATURES>" (featureSetContent teamName groupName)
  20. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement