ae5f09a5071dbb45a43c35699532f7be0c972e4c291afd5f3d4144aeaeabd03f964d3a4846c413b0e2e63b3c273924230e6c75c19b7dd68d0525a20ac4



옵시디언에 글 쓰면서 암 생각없이 박아놓은 스샷이나 이미지들 마크다운 파일 읽어서 패턴 감지해서 문자열 뽑은 걸로 특정 폴더에 알아서 파일 이동해주는거

개발 본업 끝나고 밤 늦게 코드 또 손수 짤려니까 너무 귀찮아 가지고 한 달 정도 미뤘는데 (+ 파이썬 코드 짜기 싫은 것도 있음)

걍 모르겠다 싶어서 개발새발인 영어로 하나하나씩 스텝 밟아가면서 코드 뽑아 달라니까 얘가 뽑아내는 코드가 뭔가 사족은 많긴 한데 일단 움직이는거 뽑아주긴 함.

사실 생성된 코드 한 군데 코드 찐빠난 거 있어서 발견해서 고쳐달라고 하긴 했음. (7-8번)


프롬프트는 이거


1. I'll create simple python script program with you step by step. At first, we should have a main function and get a first command argument to be searched as a path.

2. next, We'll traverse all files which is `.md` specifier (markdown file) of all subdirectories of `search_path` if `search_path` is exist on filesystem.

3. Next, we'll open `md_file` of `found_files` from `find_markdown_files` and get a string list which each string starts with `![[` and ends with `]]`.

4. With extracted `pattern`, we should check this contains `|` (pipe) character so that extract the string before the character or just use entire string as a file name that I want to do some process with it.

5. Following the process has some complicated. With `filename`, we can find actual path of given `filename` by searching files from root directory we provides as a `search_path` recursively. If found actual path of `filename`, find first directory path called `Asset` from last directory which has `md_file` file to root directory.

6. If we found the directory called `Asset`, you should move actual file of `filename` into that directory. If `filename` is already included in `Asset` directory, pass it. That's all.


여기서 한 번 코드 복붙해서 한번 테스트해보고, 잘 안되서 떼엥 몰라 고쳐달라고 해 함


7. I tried your codes but did not work. Could you fix it?


다시 생성한거 가지고 한번 더 테스트했는데 안되서 걍 눈으로 코드 따라가면서 디버그해서 지적날림.


8. You don't have to get `base_name` from `filename`, but just match `filename` with given `target_name_lower`. I fixed there and it works.



한 1~2시간 걸릴거 20~30분 정도로 끝나는 듯?