File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -56,28 +56,27 @@ async function showProblemInternal(node: IProblem): Promise<void> {
56
56
const outputPath : RegExpMatchArray | null = outputPathCfg . match ( / \$ \{ ( .* ?) \} / ) ;
57
57
if ( outputPath ) {
58
58
switch ( outputPath [ 1 ] . toLowerCase ( ) ) {
59
- case "tag" : {
59
+ case "tag" :
60
60
const closestTag : string = node . tags . reduce ( ( prev : string , curr : string ) => {
61
61
return curr . length > prev . length ?
62
62
curr :
63
63
prev ;
64
64
} , "" ) ;
65
65
outDir = path . join ( outDir , closestTag ) ;
66
66
break ;
67
- }
68
- case "language" : {
67
+ case "language" :
69
68
outDir = path . join ( outDir , language ) ;
70
69
break ;
71
- }
72
- case "difficulty" : {
70
+ case "difficulty" :
73
71
outDir = path . join ( outDir , node . difficulty ) ;
74
72
break ;
75
- }
76
73
default : {
77
74
break ;
78
75
}
79
76
80
77
}
78
+ } else {
79
+ outDir = path . join ( outDir , outputPathCfg ) ;
81
80
}
82
81
await fse . ensureDir ( outDir ) ;
83
82
const result : string = await leetCodeExecutor . showProblem ( node . id , language , outDir ) ;
You can’t perform that action at this time.
0 commit comments