MCPcopy Index your code
hub / github.com/garrytan/gstack / installSkillToTempHome

Function installSkillToTempHome

test/helpers/codex-session-runner.ts:108–130  ·  view source on GitHub ↗
(
  skillDir: string,
  skillName: string,
  tempHome?: string,
)

Source from the content-addressed store, hash-verified

106 * Returns the temp HOME path. Caller is responsible for cleanup.
107 */
108export function installSkillToTempHome(
109 skillDir: string,
110 skillName: string,
111 tempHome?: string,
112): string {
113 const home = tempHome || fs.mkdtempSync(path.join(os.tmpdir(), 'codex-e2e-'));
114 const destDir = path.join(home, '.codex', 'skills', skillName);
115 fs.mkdirSync(destDir, { recursive: true });
116
117 const srcSkill = path.join(skillDir, 'SKILL.md');
118 if (fs.existsSync(srcSkill)) {
119 fs.copyFileSync(srcSkill, path.join(destDir, 'SKILL.md'));
120 }
121
122 const srcOpenAIYaml = path.join(skillDir, 'agents', 'openai.yaml');
123 if (fs.existsSync(srcOpenAIYaml)) {
124 const destAgentsDir = path.join(destDir, 'agents');
125 fs.mkdirSync(destAgentsDir, { recursive: true });
126 fs.copyFileSync(srcOpenAIYaml, path.join(destAgentsDir, 'openai.yaml'));
127 }
128
129 return home;
130}
131
132// --- Main runner ---
133

Callers 1

runCodexSkillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected