File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @codeshift/cli ' : patch
3+ ---
4+
5+ List CLI command no longer exits on error. Instead it will log a message
Original file line number Diff line number Diff line change 1- export class NoTransformsExistError extends Error { }
21export class InvalidUserInputError extends Error { }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import main from './main';
33import list from './list' ;
44import init from './init' ;
55import validate from './validate' ;
6- import { NoTransformsExistError , InvalidUserInputError } from './errors' ;
6+ import { InvalidUserInputError } from './errors' ;
77
88import packageJson from '../package.json' ;
99import { Command , Option , CommanderError } from 'commander' ;
@@ -124,11 +124,6 @@ try {
124124 process . exit ( 9 ) ;
125125 }
126126
127- if ( error instanceof NoTransformsExistError ) {
128- console . warn ( chalk . yellow ( error . message ) ) ;
129- process . exit ( 0 ) ;
130- }
131-
132127 console . error ( chalk . red ( error ) ) ;
133128 process . exit ( 3 ) ;
134129}
Original file line number Diff line number Diff line change 11import chalk from 'chalk' ;
22import { PluginManager } from 'live-plugin-manager' ;
3- import { NoTransformsExistError } from './errors' ;
43
54export default async function list ( packages : string [ ] ) {
65 const packageManager = new PluginManager ( ) ;
@@ -13,8 +12,10 @@ export default async function list(packages: string[]) {
1312 try {
1413 await packageManager . install ( codemodName ) ;
1514 } catch ( error ) {
16- throw new NoTransformsExistError (
17- `No transforms found for package ${ pkgSplit [ 0 ] } ` ,
15+ console . log (
16+ chalk . red (
17+ `Unable to find codeshift package: ${ chalk . bold ( codemodName ) } .` ,
18+ ) ,
1819 ) ;
1920 }
2021
You can’t perform that action at this time.
0 commit comments