From 0d9b376bb99d2898bd123ddc074d2bb9a42b901a Mon Sep 17 00:00:00 2001 From: monoid Date: Thu, 21 Apr 2022 18:55:48 +0900 Subject: [PATCH] refact: more clear name --- cli.py | 2 +- tools/README.md | 2 +- tools/printDocument.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli.py b/cli.py index d8e4eb3..c575c11 100644 --- a/cli.py +++ b/cli.py @@ -22,7 +22,7 @@ def build(args): print("build issues") p = subprocess.run(["deno", "run", "-A","tools/printDocument.ts", "--overall", "--path", "./build/issues.json", "--outpath", "./build/overall.md"]) p.check_returncode() - p = subprocess.run(["deno", "run", "-A","tools/printDocument.ts", "--path", "./build/issues.json", "--outpath", "./build/specific.md"]) + p = subprocess.run(["deno", "run", "-A","tools/printDocument.ts", "--issue_path", "./build/issues.json", "--outpath", "./build/specific.md"]) p.check_returncode() def help(_args): diff --git a/tools/README.md b/tools/README.md index 04fb9b9..30217d3 100644 --- a/tools/README.md +++ b/tools/README.md @@ -23,5 +23,5 @@ deno run --allow-read --allow-write printDocument.ts --overall --path ./issues.j 다음과 같은 인자를 가집니다: - `overall`: overall을 출력 - `outpath`: 지정된 경로에 출력. 설정되지 않으면 `stdout`에 출력함. -- `path`: json 파일 위치. 지정되지 않으면 `stdin`에서 읽으려고 시도. +- `issue_path`: json 파일 위치. 지정되지 않으면 `stdin`에서 읽으려고 시도. - `w`, `watch`: 파일에 변경이 있을 때 자동으로 업데이트. \ No newline at end of file diff --git a/tools/printDocument.ts b/tools/printDocument.ts index e13546a..fad0c4b 100644 --- a/tools/printDocument.ts +++ b/tools/printDocument.ts @@ -48,9 +48,9 @@ async function readAndPrint(args: { async function main() { const parsedArg = argParse(Deno.args); - const { path, outpath, overall, w, watch } = parsedArg; + const { issue_path, outpath, overall, w, watch } = parsedArg; const watchMode = w || watch; - if (typeof path !== "undefined" && typeof path !== "string") { + if (typeof issue_path !== "undefined" && typeof issue_path !== "string") { console.log("Please provide a path to the json file."); Deno.exit(1); } @@ -66,7 +66,7 @@ async function main() { console.log("Please provide a boolean value for w."); Deno.exit(1); } - if (watchMode && typeof path === "undefined") { + if (watchMode && typeof issue_path === "undefined") { console.log("Could not set watch mode without a path."); Deno.exit(1); } @@ -79,7 +79,7 @@ async function main() { "view cache": false, }); - const c = await readContent(path); + const c = await readContent(issue_path); const issues = JSON.parse(c) as Issue[]; issues.sort((a, b) => a.number - b.number); await readAndPrint({ path, outpath, overall });