File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -215,14 +215,11 @@ pub fn finalize(res_config: Option<ArtifactResolutionConfig>) -> Result<String>
215
215
deps : Default :: default ( ) ,
216
216
} ;
217
217
218
- if let Some ( config) = res_config {
219
- // Typically happens when the cli is used
220
- if let Some ( prefix) = config. prefix . clone ( ) {
221
- tg. meta . prefix = Some ( prefix) ;
222
- }
223
-
224
- TypegraphPostProcessor :: new ( config) . postprocess ( & mut tg) ?;
225
- }
218
+ let config = res_config. map ( |config| {
219
+ tg. meta . prefix = config. prefix . clone ( ) ;
220
+ config
221
+ } ) ;
222
+ TypegraphPostProcessor :: new ( config) . postprocess ( & mut tg) ?;
226
223
227
224
Store :: restore ( ctx. saved_store_state . unwrap ( ) ) ;
228
225
Original file line number Diff line number Diff line change @@ -24,22 +24,28 @@ pub trait PostProcessor {
24
24
25
25
/// Compose all postprocessors
26
26
pub struct TypegraphPostProcessor {
27
- config : ArtifactResolutionConfig ,
27
+ config : Option < ArtifactResolutionConfig > ,
28
28
}
29
29
30
30
impl TypegraphPostProcessor {
31
- pub fn new ( config : ArtifactResolutionConfig ) -> Self {
31
+ pub fn new ( config : Option < ArtifactResolutionConfig > ) -> Self {
32
32
Self { config }
33
33
}
34
34
}
35
35
36
36
impl PostProcessor for TypegraphPostProcessor {
37
37
fn postprocess ( self , tg : & mut Typegraph ) -> Result < ( ) , TgError > {
38
- Store :: set_deploy_cwd ( self . config . dir ) ;
39
- PrismaProcessor :: new ( self . config . prisma_migration ) . postprocess ( tg) ?;
38
+ if let Some ( config) = self . config {
39
+ Store :: set_deploy_cwd ( config. dir ) ; // fs_host::cwd() will now use this value
40
+ PrismaProcessor :: new ( config. prisma_migration ) . postprocess ( tg) ?;
41
+ }
42
+
43
+ // Artifact resolution depends on the default cwd() (parent process)
44
+ // unless overwritten by `dir` through Store::set_deploy_cwd(..) (cli or custom dir with tgDeploy)
40
45
DenoProcessor . postprocess ( tg) ?;
41
46
PythonProcessor . postprocess ( tg) ?;
42
47
WasmedgeProcessor . postprocess ( tg) ?;
48
+
43
49
ValidationProcessor . postprocess ( tg) ?;
44
50
Ok ( ( ) )
45
51
}
You can’t perform that action at this time.
0 commit comments