setupProject :: String -> IO ()
setupProject file = do
  origin <- readProcess "git"
            ["config", "--get", "remote.origin.url"]
            ""
  case P.parseOnly parseGitUrl (T.pack (origin)) of
    Left  msg    -> print msg
    Right gitUrl -> do
      print gitUrl
      cfg <- decodeFile file :: IO (Maybe GliCfg)
      case cfg of
        Nothing -> putStrLn $ mappend "Unable to parse file " (show file)
        Just b  -> if M.null matchedKeyVal
          then putStrLn $ mappend "Unable to find a relevent key for \
                                  \the domain, please check the config \
                                  \file " (show file)
          else do
          project <- getProject
            (T.strip (T.pack origin)) (head $ M.elems $  matchedKeyVal)
          encodeFile localYmlFile (LocalYmlContent
                                   (MasterFileConfig file matchedKey)
                                    project)
          appendFile gitInfoExcludeFile localYmlFile
          where
            matchedKey = head $ M.keys $ matchedKeyVal
            matchedKeyVal = fetchKeyFromAccount (accounts b) (domain gitUrl)
setupProject :: String -> IO ()
setupProject file = do
  origin <- readProcess "git"
            ["config", "--get", "remote.origin.url"]
            ""
  case P.parseOnly parseGitUrl (T.pack (origin)) of
    Left  msg    -> print msg
    Right gitUrl -> do
      print gitUrl
      cfg <- decodeFile file :: IO (Maybe GliCfg)
      case cfg of
        Nothing -> putStrLn $ mappend "Unable to parse file " (show file)
        Just b  -> if M.null matchedKeyVal
          then putStrLn $ mappend "Unable to find a relevent key for \
                                  \the domain, please check the config \
                                  \file " (show file)
          else do
          project <- getProject
            (T.strip (T.pack origin)) (head $ M.elems $  matchedKeyVal)
          encodeFile localYmlFile (LocalYmlContent
                                   (MasterFileConfig file matchedKey)
                                    project)
          appendFile gitInfoExcludeFile localYmlFile
          where
            matchedKey = head $ M.keys $ matchedKeyVal
            matchedKeyVal = fetchKeyFromAccount (accounts b) (domain gitUrl)
setupProject file = do
  origin <- readProcess "git"
            ["config", "--get", "remote.origin.url"]
            ""
  case P.parseOnly parseGitUrl (T.pack (origin)) of
    Left  msg    -> print msg
    Right gitUrl -> do
      print gitUrl
      cfg <- decodeFile file :: IO (Maybe GliCfg)
      case cfg of
        Nothing -> putStrLn $ mappend "Unable to parse file " (show file)
        Just b  -> if M.null matchedKeyVal
          then putStrLn $ mappend "Unable to find a relevent key for \
                                  \the domain, please check the config \
                                  \file " (show file)
          else do
          project <- getProject
            (T.strip (T.pack origin)) (head $ M.elems $  matchedKeyVal)
          encodeFile localYmlFile (LocalYmlContent
                                   (MasterFileConfig file matchedKey)
                                    project)
          appendFile gitInfoExcludeFile localYmlFile
          where
            matchedKey = head $ M.keys $ matchedKeyVal
            matchedKeyVal = fetchKeyFromAccount (accounts b) (domain gitUrl)