fix(skills): generate executable download install plans

This commit is contained in:
William Valentin
2026-02-17 10:29:49 -08:00
parent 776b47f80f
commit e158968e03
3 changed files with 30 additions and 3 deletions
+13 -1
View File
@@ -55,8 +55,20 @@ describe('buildInstallerPlan', () => {
expect(plan.steps).toEqual([
{ installerType: 'go', command: 'go install example.com/tool/a@latest' },
{ installerType: 'go', command: 'go install example.com/tool/b@latest' },
{ installerType: 'download', command: 'download https://example.com/tool.tgz -> /tmp/tool.tgz' },
{ installerType: 'download', command: 'curl -fsSL -o /tmp/tool.tgz https://example.com/tool.tgz' },
]);
expect(plan.skipped).toEqual([]);
});
it('skips download installer when destination is missing', () => {
const plan = buildInstallerPlan(
[{ type: 'download', url: 'https://example.com/tool.tgz' }],
{ hasBinary: () => true },
);
expect(plan.steps).toEqual([]);
expect(plan.skipped).toEqual([
{ installerType: 'download', reason: 'download destination is required for executable install plans' },
]);
});
});
+5 -2
View File
@@ -73,10 +73,13 @@ export function buildInstallerPlan(
continue;
}
const destination = installer.destination ?? '<default destination>';
if (!installer.destination) {
skipped.push({ installerType: 'download', reason: 'download destination is required for executable install plans' });
continue;
}
steps.push({
installerType: 'download',
command: `download ${installer.url} -> ${destination}`,
command: `curl -fsSL -o ${installer.destination} ${installer.url}`,
});
}