File tree Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -43,27 +43,13 @@ let removePathPrefix ~prefix path =
4343let appendSuffix ~config sourcePath =
4444 (sourcePath |> handleNamespace) ^ ModuleExtension. tsInputFileSuffix ~config
4545
46- let getOutputFileRelative ~config sourcePath =
47- if Filename. is_relative sourcePath then appendSuffix ~config sourcePath
48- else
49- let relative_path =
50- removePathPrefix ~prefix: config.projectRoot sourcePath
51- in
52- appendSuffix ~config relative_path
53-
54- let computeAbsoluteOutputFilePath ~(config : Config.t ) path =
55- Filename. concat config.projectRoot (getOutputFileRelative ~config path)
46+ let getOutputFileRelative ~(config : Config.t ) path =
47+ let relativePath = removePathPrefix ~prefix: config.projectRoot path in
48+ appendSuffix ~config relativePath
5649
57- let getOutputFile ~(config : Config.t ) sourcePath =
58- if Filename. is_relative sourcePath then
59- (* assuming a relative path from the project root *)
60- computeAbsoluteOutputFilePath ~config sourcePath
61- else
62- (* for absolute paths we want to place the output beside the source file *)
63- let relative_path =
64- removePathPrefix ~prefix: config.projectRoot sourcePath
65- in
66- computeAbsoluteOutputFilePath ~config relative_path
50+ let getOutputFile ~(config : Config.t ) absoluteSourcePath =
51+ let relativeOutputPath = getOutputFileRelative ~config absoluteSourcePath in
52+ Filename. concat config.projectRoot relativeOutputPath
6753
6854let getModuleName cmt =
6955 cmt |> handleNamespace |> Filename. basename |> ModuleName. fromStringUnsafe
You can’t perform that action at this time.
0 commit comments