(args: RuntimeSubmoduleSyncArgs)
| 73 | } |
| 74 | |
| 75 | async function runSubmoduleMaterialization(args: RuntimeSubmoduleSyncArgs): Promise<void> { |
| 76 | const env = buildGitExecutionEnv({ env: args.env, trusted: args.trusted }); |
| 77 | |
| 78 | // Skills, docs, and other workspace-managed files can live inside submodules. |
| 79 | // Materialize them before init hooks or downstream runtime setup so later discovery |
| 80 | // doesn't misdiagnose missing files as invalid workspace state. |
| 81 | args.initLogger.logStep("Initializing git submodules..."); |
| 82 | |
| 83 | try { |
| 84 | await runSubmoduleCommand({ |
| 85 | runtime: args.runtime, |
| 86 | workspacePath: args.workspacePath, |
| 87 | abortSignal: args.abortSignal, |
| 88 | env, |
| 89 | command: SUBMODULE_SYNC_COMMAND, |
| 90 | timeout: SUBMODULE_SYNC_TIMEOUT_SECS, |
| 91 | fallbackError: "git submodule sync failed", |
| 92 | }); |
| 93 | await runSubmoduleCommand({ |
| 94 | runtime: args.runtime, |
| 95 | workspacePath: args.workspacePath, |
| 96 | abortSignal: args.abortSignal, |
| 97 | env, |
| 98 | command: SUBMODULE_UPDATE_COMMAND, |
| 99 | timeout: SUBMODULE_UPDATE_TIMEOUT_SECS, |
| 100 | fallbackError: "git submodule update failed", |
| 101 | }); |
| 102 | } catch (error) { |
| 103 | throw formatSubmoduleSyncError(error); |
| 104 | } |
| 105 | |
| 106 | args.initLogger.logStep("Git submodules ready"); |
| 107 | } |
| 108 | |
| 109 | async function hasLocalGitmodules(workspacePath: string): Promise<boolean> { |
| 110 | const gitmodulesPath = path.join(workspacePath, ".gitmodules"); |
no test coverage detected