@@ -9,37 +9,41 @@ import Data.Romefile (_frameworkPlatforms)
9
9
import Types hiding (version )
10
10
import Utils
11
11
import qualified Turtle
12
+ import System.FilePath ((</>) )
12
13
13
14
14
15
-- | Probes a `FilePath` to check if each `FrameworkVersion` exists for each `TargetPlatform`
15
16
probeEngineForFrameworks
16
17
:: MonadIO m
17
18
=> FilePath -- ^ The `FilePath` to the engine
19
+ -> CachePrefix -- ^ The top level directory prefix.
18
20
-> InvertedRepositoryMap -- ^ The map used to resolve `FrameworkName`s to `GitRepoName`s.
19
21
-> [FrameworkVersion ] -- ^ A list of `FrameworkVersion` to probe for.
20
22
-> [TargetPlatform ] -- ^ A list target platforms restricting the scope of this action.
21
23
-> m [FrameworkAvailability ]
22
- probeEngineForFrameworks lCacheDir reverseRomeMap frameworkVersions
24
+ probeEngineForFrameworks lCacheDir cachePrefix reverseRomeMap frameworkVersions
23
25
= sequence . probeForEachFramework
24
26
where
25
27
probeForEachFramework = mapM
26
- (probeEngineForFramework lCacheDir reverseRomeMap)
28
+ (probeEngineForFramework lCacheDir cachePrefix reverseRomeMap)
27
29
frameworkVersions
28
30
29
31
30
32
-- | Probes the engine at `FilePath` to check if a `FrameworkVersion` exists for each `TargetPlatform`
31
33
probeEngineForFramework
32
34
:: MonadIO m
33
35
=> FilePath -- ^ The `FilePath` to the engine
36
+ -> CachePrefix -- ^ The top level directory prefix.
34
37
-> InvertedRepositoryMap -- ^ The map used to resolve `FrameworkName`s to `GitRepoName`s.
35
38
-> FrameworkVersion -- ^ The `FrameworkVersion` to probe for.
36
39
-> [TargetPlatform ] -- ^ A list target platforms restricting the scope of this action.
37
40
-> m FrameworkAvailability
38
- probeEngineForFramework lCacheDir reverseRomeMap frameworkVersion platforms
41
+ probeEngineForFramework lCacheDir cachePrefix reverseRomeMap frameworkVersion platforms
39
42
= fmap (FrameworkAvailability frameworkVersion) probeForEachPlatform
40
43
where
41
44
probeForEachPlatform = mapM
42
45
(probeEngineForFrameworkOnPlatform lCacheDir
46
+ cachePrefix
43
47
reverseRomeMap
44
48
frameworkVersion
45
49
)
@@ -50,16 +54,17 @@ probeEngineForFramework lCacheDir reverseRomeMap frameworkVersion platforms
50
54
probeEngineForFrameworkOnPlatform
51
55
:: MonadIO m
52
56
=> FilePath -- ^ The `FilePath` to the engine
57
+ -> CachePrefix -- ^ The top level directory prefix.
53
58
-> InvertedRepositoryMap -- ^ The map used to resolve `FrameworkName`s to `GitRepoName`s.
54
59
-> FrameworkVersion -- ^ The `FrameworkVersion` to probe for.
55
60
-> TargetPlatform -- ^ A target platforms restricting the scope of this action.
56
61
-> m PlatformAvailability
57
- probeEngineForFrameworkOnPlatform enginePath reverseRomeMap (FrameworkVersion fwn version) platform
62
+ probeEngineForFrameworkOnPlatform enginePath ( CachePrefix prefix) reverseRomeMap (FrameworkVersion fwn version) platform
58
63
= do
59
64
let cmd = Turtle. fromString enginePath
60
65
exitCode <- Turtle. proc
61
66
cmd
62
- [" list" , Turtle. fromString remoteFrameworkUploadPath]
67
+ [" list" , Turtle. fromString (prefix </> remoteFrameworkUploadPath) ]
63
68
(return $ Turtle. unsafeTextToLine " " )
64
69
case exitCode of
65
70
-- If engine exits with success, we assume the framework exists.
0 commit comments