lib: expand current directory separately from filepath
We will need the current directory as an absolute path when adding glob patterns in a few commits time.
This commit is contained in:
		
							parent
							
								
									9e56ad24e2
								
							
						
					
					
						commit
						52da073828
					
				| @ -193,9 +193,11 @@ includedirectivep = do | ||||
| 
 | ||||
|   parentpos <- getPosition | ||||
| 
 | ||||
|   curdir <- lift $ expandPath (takeDirectory $ sourceName parentpos) "" | ||||
|                    `orRethrowIOError` (show parentpos ++ " locating " ++ filename) | ||||
|    -- </> correctly handles case when 'filename' is absolute | ||||
|   let filepath = curdir </> filename | ||||
|   -- read child input | ||||
|   let curdir = takeDirectory (sourceName parentpos) | ||||
|   filepath <- lift $ expandPath curdir filename `orRethrowIOError` (show parentpos ++ " locating " ++ filename) | ||||
|   childInput <- lift $ readFilePortably filepath `orRethrowIOError` (show parentpos ++ " reading " ++ filepath) | ||||
| 
 | ||||
|   -- save parent state | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user