Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add outputPath Config #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
jdneo merged 15 commits into LeetCode-OpenSource:master from ringcrl:master
Feb 16, 2019
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Update judgment condition
  • Loading branch information
chengruilin committed Feb 15, 2019
commit 3b7a86a6d974320098ff0849047a57ce4d8cf335
11 changes: 5 additions & 6 deletions src/commands/show.ts
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,27 @@ async function showProblemInternal(node: IProblem): Promise<void> {
const outputPath: RegExpMatchArray | null = outputPathCfg.match(/\$\{(.*?)\}/);
if (outputPath) {
switch (outputPath[1].toLowerCase()) {
case "tag": {
case "tag":
const closestTag: string = node.tags.reduce((prev: string, curr: string) => {
return curr.length > prev.length ?
curr :
prev;
}, "");
outDir = path.join(outDir, closestTag);
break;
}
case "language": {
case "language":
outDir = path.join(outDir, language);
break;
}
case "difficulty": {
case "difficulty":
outDir = path.join(outDir, node.difficulty);
break;
}
default: {
break;
}

}
} else {
outDir = path.join(outDir, outputPathCfg);
}
await fse.ensureDir(outDir);
const result: string = await leetCodeExecutor.showProblem(node.id, language, outDir);
Expand Down

AltStyle によって変換されたページ (->オリジナル) /