File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
parse-todo-of-stacked-rebase Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,17 @@ export function parseNewGoodCommands(
2222 logGoodCmds ( oldGoodCommands ) ;
2323
2424 const pathOfRewrittenList : string = path . join ( repo . path ( ) , "stacked-rebase" , filenames . rewrittenList ) ;
25- const rewrittenList : string = fs . readFileSync ( pathOfRewrittenList , { encoding : "utf-8" } ) ;
25+ const pathOfRewrittenListApplied : string = path . join ( repo . path ( ) , "stacked-rebase" , filenames . applied ) ;
26+ let rewrittenList : string ;
27+ if ( fs . existsSync ( pathOfRewrittenList ) ) {
28+ rewrittenList = fs . readFileSync ( pathOfRewrittenList , { encoding : "utf-8" } ) ;
29+ } else if ( fs . existsSync ( pathOfRewrittenListApplied ) ) {
30+ rewrittenList = fs . readFileSync ( pathOfRewrittenListApplied , { encoding : "utf-8" } ) ;
31+ } else {
32+ throw new Error (
33+ `rewritten-list not found neither in ${ pathOfRewrittenList } , nor in ${ pathOfRewrittenListApplied } `
34+ ) ;
35+ }
2636 const { combinedRewrittenList } = combineRewrittenLists ( rewrittenList ) ;
2737 const rewrittenListLines : string [ ] = combinedRewrittenList . split ( "\n" ) . filter ( ( line ) => ! ! line ) ;
2838
You can’t perform that action at this time.
0 commit comments