Skip to content

싸인 재활용하는 옵션 추가 #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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

dohvis
Copy link

@dohvis dohvis commented Jan 7, 2021

csv.csv 2021 --reuse-sign

위처럼 --reuse-sign 옵션으로 싸인 그리는 과정을 스킵합니다.

tmp folder에 만들었던 싸인을 저장하는 방식이고 아무 옵션도 주지 않으면 기존처럼 매번 웹 브라우저를 띄워줍니다.

생성된 pdf 가 기대와 다를 때 싸인은 또 매번 해줘야 하는게 번거로워 구현했습니다.

dohvis added 2 commits January 8, 2021 02:42
모종의 이유로 기대와 다른 pdf 가 생성될 경우 다시 돌려야하는데 그때마다 서명을 하는게 번거로워 구현
Copy link
Owner

@jen6 jen6 left a 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");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
최근 제가 사용하는 cli 툴들은 대부분 ~/.config/application-name 이런식으로 생성해서 사용하는것 같습니다.
tmp 폴더도 상관없긴하지만 이왕이면 폴더를 생성하거나 하면 좋을듯 합니다


async function getSignature(isReuseSign) {
var data = "";
if (isReuseSign === true) {
Copy link
Owner

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");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 위에 example이랑 Usage 에도 추가해주실 수 있을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants