Skip to content

Commit

Permalink
Throw an error when rzk.yaml include is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
aabounegm authored and fizruk committed Dec 11, 2023
1 parent 127da4e commit e3969d5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions rzk/src/Rzk/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

module Rzk.Main where

import Control.Monad (forM, when)
import Data.List (sort)
import qualified Data.Yaml as Yaml
import System.Directory (doesPathExist)
import System.FilePath.Glob (glob)
import qualified Language.Rzk.Syntax as Rzk
import Control.Monad (forM, when)
import Data.List (sort)
import qualified Data.Yaml as Yaml
import System.Directory (doesPathExist)
import System.FilePath.Glob (glob)

import qualified Language.Rzk.Syntax as Rzk
import Rzk.Project.Config
import Rzk.TypeCheck

Expand Down Expand Up @@ -69,6 +70,7 @@ parseRzkFilesOrStdin = \case
then do
putStrLn ("Using Rzk project stucture specified in " <> rzkYamlPath)
paths <- extractFilesFromRzkYaml rzkYamlPath
when (null paths) (error $ "No files found in " <> rzkYamlPath)
parseRzkFilesOrStdin paths
else do
rzkModule <- parseStdin
Expand Down

0 comments on commit e3969d5

Please sign in to comment.