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 { }
2
1
export class InvalidUserInputError extends Error { }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import main from './main';
3
3
import list from './list' ;
4
4
import init from './init' ;
5
5
import validate from './validate' ;
6
- import { NoTransformsExistError , InvalidUserInputError } from './errors' ;
6
+ import { InvalidUserInputError } from './errors' ;
7
7
8
8
import packageJson from '../package.json' ;
9
9
import { Command , Option , CommanderError } from 'commander' ;
@@ -124,11 +124,6 @@ try {
124
124
process . exit ( 9 ) ;
125
125
}
126
126
127
- if ( error instanceof NoTransformsExistError ) {
128
- console . warn ( chalk . yellow ( error . message ) ) ;
129
- process . exit ( 0 ) ;
130
- }
131
-
132
127
console . error ( chalk . red ( error ) ) ;
133
128
process . exit ( 3 ) ;
134
129
}
Original file line number Diff line number Diff line change 1
1
import chalk from 'chalk' ;
2
2
import { PluginManager } from 'live-plugin-manager' ;
3
- import { NoTransformsExistError } from './errors' ;
4
3
5
4
export default async function list ( packages : string [ ] ) {
6
5
const packageManager = new PluginManager ( ) ;
@@ -13,8 +12,10 @@ export default async function list(packages: string[]) {
13
12
try {
14
13
await packageManager . install ( codemodName ) ;
15
14
} 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
+ ) ,
18
19
) ;
19
20
}
20
21
You can’t perform that action at this time.
0 commit comments