nexscope 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexscope",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "NexScope CLI tool",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -89,6 +89,10 @@ function runSkillsSync(skillsArgs) {
89
89
  });
90
90
  }
91
91
 
92
+ function runSkillsSilent(skillsArgs) {
93
+ return spawnAsync('npx', ['skills', ...skillsArgs]);
94
+ }
95
+
92
96
  async function run(args) {
93
97
  if (args.includes('--help') || args.includes('-h')) {
94
98
  printHelp();
@@ -112,15 +116,20 @@ async function run(args) {
112
116
  }
113
117
 
114
118
  const installed = await getInstalledSkills(dirFlags);
115
- if (installed.includes(skillName)) {
116
- console.log(`Skill "${skillName}" is already installed. Skipping.`);
117
- printThankYou();
118
- return;
119
+
120
+ const tasks = new Listr([{
121
+ title: skillName,
122
+ skip: () => installed.includes(skillName) ? 'Already installed' : false,
123
+ task: () => runSkillsSilent(['add', SKILLS_REPO, '--skill', skillName, '-y', ...dirFlags]),
124
+ }], { exitOnError: false });
125
+
126
+ try {
127
+ await tasks.run();
128
+ } catch {
129
+ // error already shown by listr2
119
130
  }
120
131
 
121
- const code = await runSkillsSync(['add', SKILLS_REPO, '--skill', skillName, '-y', ...dirFlags]);
122
132
  printThankYou();
123
- process.exit(code || 0);
124
133
  } else {
125
134
  process.stdout.write('Fetching skill list... ');
126
135
  const [skills, installed] = await Promise.all([