-
Notifications
You must be signed in to change notification settings - Fork 9
싸인 재활용하는 옵션 추가 #5
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
base: main
Are you sure you want to change the base?
Conversation
모종의 이유로 기대와 다른 pdf 가 생성될 경우 다시 돌려야하는데 그때마다 서명을 하는게 번거로워 구현
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 감사합니다!
약간 마음에 걸리는건 --reuse-sign
이라는 옵션이 맞는건지 싶습니다.
기본적으로 로컬에 저장된 사인 이미지를 쓰다가 없을경우 새로 생성해주고
유저가 저장된 사인대신 새로운 사인을 사용하고 싶을 때 --renew-sign
혹은 --with-new-sign
이런식으로 사용하는게 더 편하지 않을까 싶은데 어떻게 생각하시나요?
async function getSignature() { | ||
function getSignatureFilePath() { | ||
const tmpDir = os.tmpdir(); | ||
filePath = path.join(tmpDir, "workDiary-signature.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
async function getSignature(isReuseSign) { | ||
var data = ""; | ||
if (isReuseSign === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
early return 으로 해주시면 가독성이 좀 올라갈것 같습니다
if (isReuseSign === false) {
return
}
~~
@@ -285,6 +310,9 @@ async function main(){ | |||
if (typeof year === "undefined") { | |||
year = new Date().getFullYear().toString(); | |||
} | |||
const reuseSign = myArgs.filter((arg) => arg === "--reuse-sign"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 위에 example이랑 Usage 에도 추가해주실 수 있을까요?
csv.csv 2021 --reuse-sign
위처럼 --reuse-sign 옵션으로 싸인 그리는 과정을 스킵합니다.
tmp folder에 만들었던 싸인을 저장하는 방식이고 아무 옵션도 주지 않으면 기존처럼 매번 웹 브라우저를 띄워줍니다.
생성된 pdf 가 기대와 다를 때 싸인은 또 매번 해줘야 하는게 번거로워 구현했습니다.