git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1900 from nwolverson/sourcemap-output-fix

Fix source map path with default output dir

commitf5636d9807031c152e7d45e4d8f1963f8653197e authorPhil Freeman <paf31@cantab.net> dateSun 28 Feb 2016, 16:07 (11 years ago) parent6caa048d167155
1 file changed+2−2
src/Language/PureScript/Make.hs+2−2
src/Language/PureScript/Make.hs+2−2
@@ -57,7 +57,7 @@ import SourceMap
5757
5858import System.Directory
5959 (doesFileExist, getModificationTime, createDirectoryIfMissing, getCurrentDirectory)
60−import System.FilePath ((</>), takeDirectory, makeRelative, splitPath)
60+import System.FilePath ((</>), takeDirectory, makeRelative, splitPath, normalise)
6161import System.IO.Error (tryIOError)
6262import System.IO.UTF8 (readUTF8File, writeUTF8File)
6363
@@ -351,7 +351,7 @@ buildMakeActions outputDir filePathMap foreigns usePrefix =
351351
352352 genSourceMap :: String -> String -> Int -> [SMap] -> Make ()
353353 genSourceMap dir mapFile extraLines mappings = do
354− let pathToDir = iterate (".." </>) ".." !! length (splitPath outputDir)
354+ let pathToDir = iterate (".." </>) ".." !! length (splitPath $ normalise outputDir)
355355 sourceFile = case mappings of
356356 ((SMap file _ _):_) -> Just $ pathToDir </> makeRelative dir file
357357 _ -> Nothing