Skip to content

Commit 489872d

Browse files
author
strausr
committed
chore: add instruction if skill install failed
1 parent 1041b7d commit 489872d

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

cli.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
import { fileURLToPath } from 'url';
4-
import { dirname, join } from 'path';
4+
import { dirname, join, relative } from 'path';
55
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
66
import { spawnSync, spawn } from 'child_process';
77
import inquirer from 'inquirer';
@@ -354,12 +354,22 @@ async function main() {
354354
);
355355

356356
let skillsInstalled = 0;
357+
const failedSkills = [];
357358
for (const { skill, ok } of results) {
358359
if (ok) {
359360
console.log(chalk.gray(` ✓ ${skill}`));
360361
skillsInstalled++;
361362
} else {
362-
console.warn(chalk.yellow(` ⚠ Could not install ${skill} (check your internet connection)`));
363+
console.warn(chalk.yellow(` ⚠ Could not install ${skill}`));
364+
failedSkills.push(skill);
365+
}
366+
}
367+
368+
if (failedSkills.length > 0) {
369+
const relDir = relative(projectPath, primaryDir);
370+
console.log(chalk.yellow('\n Some skills could not be installed. To install manually, run from your project directory:'));
371+
for (const skill of failedSkills) {
372+
console.log(chalk.cyan(` npx degit cloudinary-devs/skills/skills/${skill} ${relDir}/${skill}`));
363373
}
364374
}
365375

0 commit comments

Comments
 (0)