From b12717c833b5cb85242787d3a7a124e4c6e04f43 Mon Sep 17 00:00:00 2001 From: JK Date: Fri, 13 Feb 2026 19:44:47 +0900 Subject: [PATCH 1/4] fix: resolve CLI script paths relative to project root, not cwd convert_all.py and fetch_cli.py (via Config) used relative paths like "var/pages.yaml" which broke when invoked from outside confluence-mdx/. Now all default paths resolve against the script's project root (confluence-mdx/) regardless of the working directory. Co-Authored-By: Claude Opus 4.6 --- confluence-mdx/bin/convert_all.py | 19 ++++++++++++++++++- confluence-mdx/bin/fetch/config.py | 10 ++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/confluence-mdx/bin/convert_all.py b/confluence-mdx/bin/convert_all.py index 5e8b3872d..9be3baa35 100755 --- a/confluence-mdx/bin/convert_all.py +++ b/confluence-mdx/bin/convert_all.py @@ -22,12 +22,22 @@ import yaml -# Ensure bin/ is on sys.path +# Resolve project root (confluence-mdx/) from this script's location _bin_dir = str(Path(__file__).resolve().parent) +_project_root = str(Path(_bin_dir).parent) + +# Ensure bin/ is on sys.path if _bin_dir not in sys.path: sys.path.insert(0, _bin_dir) +def _resolve(path: str) -> str: + """Resolve a relative path against _project_root (confluence-mdx/).""" + if os.path.isabs(path): + return path + return os.path.join(_project_root, path) + + def load_pages_yaml(pages_yaml_path: str) -> List[Dict]: """Load pages.yaml and return list of page entries.""" with open(pages_yaml_path, 'r', encoding='utf-8') as f: @@ -170,6 +180,13 @@ def main(): help='Log level for converter/cli.py (default: warning)') args = parser.parse_args() + # Resolve relative paths against project root (confluence-mdx/) + args.pages_yaml = _resolve(args.pages_yaml) + args.var_dir = _resolve(args.var_dir) + args.output_dir = _resolve(args.output_dir) + args.public_dir = _resolve(args.public_dir) + args.translations = _resolve(args.translations) + # Load data pages = load_pages_yaml(args.pages_yaml) translations = load_translations(args.translations) diff --git a/confluence-mdx/bin/fetch/config.py b/confluence-mdx/bin/fetch/config.py index 03fa8fe93..7b291a001 100644 --- a/confluence-mdx/bin/fetch/config.py +++ b/confluence-mdx/bin/fetch/config.py @@ -2,8 +2,12 @@ import os from dataclasses import dataclass +from pathlib import Path from typing import Optional +# Project root: confluence-mdx/ (two levels up from this file) +_PROJECT_ROOT = str(Path(__file__).resolve().parent.parent.parent) + @dataclass class Config: @@ -26,3 +30,9 @@ def __post_init__(self): self.email = os.environ.get('ATLASSIAN_USERNAME', 'your-email@example.com') if self.api_token is None: self.api_token = os.environ.get('ATLASSIAN_TOKEN', 'your-api-token') + + # Resolve relative paths against project root (confluence-mdx/) + for field in ('default_output_dir', 'cache_dir', 'translations_file'): + value = getattr(self, field) + if not os.path.isabs(value): + setattr(self, field, os.path.join(_PROJECT_ROOT, value)) From 89c66d6c5b08b4d176d023ca56b2712841778aad Mon Sep 17 00:00:00 2001 From: JK Date: Fri, 13 Feb 2026 19:59:05 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=EB=82=98=EB=A8=B8=EC=A7=80=20CLI=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=EB=8F=84=20cwd=20=EB=AC=B4?= =?UTF-8?q?=EA=B4=80=ED=95=98=EA=B2=8C=20=EA=B2=BD=EB=A1=9C=20=ED=95=B4?= =?UTF-8?q?=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit convert_all.py, fetch/config.py 외 나머지 bin/ 스크립트들도 __file__ 기반으로 프로젝트 루트를 결정하여 cwd에 무관하게 동작하도록 개선. - restore_alt_from_diff.py: _REPO_ROOT 기준 git 명령 실행 및 파일경로 해석 - sync_confluence_url.py: 기본 디렉터리를 _REPO_ROOT 기준으로 해석 - skeleton/cli.py, diff.py, compare.py: target/ 기본 디렉터리를 _PROJECT_DIR 기준으로 해석 - skeleton/common.py: 절대경로에서도 target/{lang}/ 패턴 인식 (re.match → re.search) - converter/cli.py: --public-dir 기본값을 _project_dir 기준으로 해석 Co-Authored-By: Claude Opus 4.6 --- confluence-mdx/bin/converter/cli.py | 15 ++++++++++++++- confluence-mdx/bin/restore_alt_from_diff.py | 11 +++++++++-- confluence-mdx/bin/skeleton/cli.py | 10 +++++++--- confluence-mdx/bin/skeleton/common.py | 12 ++++++------ confluence-mdx/bin/skeleton/compare.py | 6 +++++- confluence-mdx/bin/skeleton/diff.py | 19 +++++++++++++------ confluence-mdx/bin/sync_confluence_url.py | 10 ++++++++-- 7 files changed, 62 insertions(+), 21 deletions(-) diff --git a/confluence-mdx/bin/converter/cli.py b/confluence-mdx/bin/converter/cli.py index 8b7c269a8..3ebcce223 100755 --- a/confluence-mdx/bin/converter/cli.py +++ b/confluence-mdx/bin/converter/cli.py @@ -16,11 +16,21 @@ import yaml -# Ensure bin/ is on sys.path when run as a script (e.g. bin/converter/cli.py) +# Resolve project root (confluence-mdx/) from this script's location _bin_dir = str(Path(__file__).resolve().parent.parent) +_project_dir = str(Path(_bin_dir).parent) + +# Ensure bin/ is on sys.path when run as a script (e.g. bin/converter/cli.py) if _bin_dir not in sys.path: sys.path.insert(0, _bin_dir) + +def _resolve(path: str) -> str: + """Resolve a relative path against _project_dir (confluence-mdx/).""" + if os.path.isabs(path): + return path + return os.path.join(_project_dir, path) + import converter.context as ctx from converter.context import ( PAGES_BY_TITLE, PAGES_BY_ID, @@ -123,6 +133,9 @@ def main(): help='Set the logging level (default: info)') args = parser.parse_args() + # Resolve relative paths against project root (confluence-mdx/) + args.public_dir = _resolve(args.public_dir) + # Configure logging with the specified level log_level = getattr(logging, args.log_level.upper()) logging.basicConfig(level=log_level, format='%(levelname)s - %(funcName)s:%(lineno)d - %(message)s') diff --git a/confluence-mdx/bin/restore_alt_from_diff.py b/confluence-mdx/bin/restore_alt_from_diff.py index 8b5626fb1..742b98290 100755 --- a/confluence-mdx/bin/restore_alt_from_diff.py +++ b/confluence-mdx/bin/restore_alt_from_diff.py @@ -13,12 +13,19 @@ from pathlib import Path from typing import Dict, List, Tuple +# Resolve repo root from this script's location +# Script is at confluence-mdx/bin/restore_alt_from_diff.py +_SCRIPT_DIR = Path(__file__).resolve().parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ +_REPO_ROOT = _PROJECT_DIR.parent # repo root + def get_diff_for_lang(lang: str) -> str: """특정 언어의 git diff 가져오기""" result = subprocess.run( ['git', 'diff', f'src/content/{lang}/'], - capture_output=True, text=True + capture_output=True, text=True, + cwd=str(_REPO_ROOT), ) return result.stdout @@ -120,7 +127,7 @@ def main(): total_changes = 0 for file_path_str, alt_mapping in file_mappings.items(): - file_path = Path(file_path_str) + file_path = _REPO_ROOT / file_path_str if not file_path.exists(): continue diff --git a/confluence-mdx/bin/skeleton/cli.py b/confluence-mdx/bin/skeleton/cli.py index c12ea9510..05130db96 100755 --- a/confluence-mdx/bin/skeleton/cli.py +++ b/confluence-mdx/bin/skeleton/cli.py @@ -91,6 +91,10 @@ from pathlib import Path from typing import List, Tuple, Optional +# Resolve project root (confluence-mdx/) from this script's location +# bin/skeleton/cli.py -> .parent=skeleton/ -> .parent=bin/ -> .parent=confluence-mdx/ +_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ + # Import modules for recursive processing and comparison from skeleton.compare import compare_files from skeleton.diff import ( @@ -1119,9 +1123,9 @@ def delete_skeleton_files(directories: List[Path]) -> int: if len(directories) == 0: # No directories specified, use defaults (Korean, Japanese, English order) default_dirs = [ - Path('target/ko'), - Path('target/ja'), - Path('target/en') + _PROJECT_DIR / 'target/ko', + _PROJECT_DIR / 'target/ja', + _PROJECT_DIR / 'target/en', ] directories = default_dirs diff --git a/confluence-mdx/bin/skeleton/common.py b/confluence-mdx/bin/skeleton/common.py index 2b25f2056..2bf1f6855 100644 --- a/confluence-mdx/bin/skeleton/common.py +++ b/confluence-mdx/bin/skeleton/common.py @@ -21,10 +21,10 @@ def extract_language_code(file_path: Path) -> Optional[str]: path_str = str(file_path) path_lower = path_str.lower() - # Check for language codes in the target/{lang}/ pattern at the start + # Check for language codes in the target/{lang}/ pattern (anywhere in path) for lang in ['ko', 'en', 'ja']: - pattern = r'^target[/\\]' + lang + r'[/\\]' - if re.match(pattern, path_lower): + pattern = r'target[/\\]' + lang + r'[/\\]' + if re.search(pattern, path_lower): return lang.lower() return None @@ -75,10 +75,10 @@ def get_path_without_lang_dir(file_path: Path) -> Optional[str]: path_str = str(file_path) path_lower = path_str.lower() - # Check for the target/{lang}/ pattern at the start (relative path only) + # Check for the target/{lang}/ pattern (anywhere in path) for lang in ['ko', 'en', 'ja']: - pattern = r'^target[/\\]' + lang + r'[/\\]' - match = re.match(pattern, path_lower) + pattern = r'target[/\\]' + lang + r'[/\\]' + match = re.search(pattern, path_lower) if match: end = match.end() relative_path = path_str[end:] diff --git a/confluence-mdx/bin/skeleton/compare.py b/confluence-mdx/bin/skeleton/compare.py index 1cea5b2ea..5ff62ab52 100644 --- a/confluence-mdx/bin/skeleton/compare.py +++ b/confluence-mdx/bin/skeleton/compare.py @@ -8,6 +8,10 @@ from pathlib import Path +# Resolve project root (confluence-mdx/) from this module's location +# bin/skeleton/compare.py -> .parent=skeleton/ -> .parent=bin/ -> .parent=confluence-mdx/ +_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ + def get_mdx_files(directory: Path) -> set[str]: """ @@ -43,7 +47,7 @@ def compare_files(verbose: bool = False): verbose: If False, skip files that exist in all three languages. If True, output all files. """ - base_dir = Path('target') + base_dir = _PROJECT_DIR / 'target' dirs = { 'ko': base_dir / 'ko', 'en': base_dir / 'en', diff --git a/confluence-mdx/bin/skeleton/diff.py b/confluence-mdx/bin/skeleton/diff.py index cf81f8168..52962207b 100644 --- a/confluence-mdx/bin/skeleton/diff.py +++ b/confluence-mdx/bin/skeleton/diff.py @@ -13,6 +13,10 @@ from pathlib import Path from typing import List, Tuple, Optional, Dict, Set +# Resolve project root (confluence-mdx/) from this module's location +# bin/skeleton/diff.py -> .parent=skeleton/ -> .parent=bin/ -> .parent=confluence-mdx/ +_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ + try: import yaml except ImportError: @@ -184,11 +188,14 @@ def filter_diff_output( Returns: Filtered diff output with ignored lines removed. Returns empty string if all differences are ignored. """ - # Normalize file path (use forward slashes, remove leading slash if present) + # Normalize file path (use forward slashes, extract target/{lang}/... portion) file_path = file_path.replace('\\', '/') - if file_path.startswith('/'): + target_match = re.search(r'target/(?:ko|en|ja)/', file_path) + if target_match: + file_path = file_path[target_match.start():] + elif file_path.startswith('/'): file_path = file_path[1:] - + # Get ignore line numbers for this file ignore_lines = ignore_rules.get(file_path, set()) @@ -527,9 +534,9 @@ def process_directories_recursive(directories: List[Path], convert_func) -> Tupl if len(directories) == 0: # No directories specified, use defaults (Korean, Japanese, English order) default_dirs = [ - Path('target/ko'), - Path('target/ja'), - Path('target/en') + _PROJECT_DIR / 'target/ko', + _PROJECT_DIR / 'target/ja', + _PROJECT_DIR / 'target/en', ] directories = default_dirs diff --git a/confluence-mdx/bin/sync_confluence_url.py b/confluence-mdx/bin/sync_confluence_url.py index ae96ffac1..a2be73f08 100755 --- a/confluence-mdx/bin/sync_confluence_url.py +++ b/confluence-mdx/bin/sync_confluence_url.py @@ -26,6 +26,12 @@ from pathlib import Path from typing import List, Optional, Tuple +# Resolve repo root from this script's location +# Script is at confluence-mdx/bin/sync_confluence_url.py +_SCRIPT_DIR = Path(__file__).resolve().parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ +_REPO_ROOT = _PROJECT_DIR.parent # repo root + # --------------------------------------------------------------------------- # Path helpers @@ -221,8 +227,8 @@ def main() -> int: targets: List[Path] = [] if args.recursive is not None: dirs = args.recursive if args.recursive else [ - Path('src/content/en'), - Path('src/content/ja'), + _REPO_ROOT / 'src/content/en', + _REPO_ROOT / 'src/content/ja', ] targets = collect_mdx_files(dirs) elif args.files: From 0f96cd3af839cff251b4d4f81f9f36168135abe0 Mon Sep 17 00:00:00 2001 From: JK Date: Fri, 13 Feb 2026 20:05:04 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=EA=B2=BD=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EB=84=A4=EC=9D=B4=EB=B0=8D=EC=9D=84=20Path=20+=20U?= =?UTF-8?q?PPERCASE=20=ED=8C=A8=ED=84=B4=EC=9C=BC=EB=A1=9C=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 모든 bin/ 스크립트의 경로 변수를 일관된 패턴으로 통일: - _SCRIPT_DIR (Path): confluence-mdx/bin/ - _PROJECT_DIR (Path): confluence-mdx/ - _REPO_ROOT (Path): repo root (필요한 스크립트만) 변경 파일: convert_all.py, converter/cli.py, fetch/config.py, skeleton/cli.py, skeleton/diff.py, skeleton/compare.py Co-Authored-By: Claude Opus 4.6 --- confluence-mdx/bin/convert_all.py | 21 +++++++++++---------- confluence-mdx/bin/converter/cli.py | 19 +++++++------------ confluence-mdx/bin/fetch/config.py | 7 ++++--- confluence-mdx/bin/skeleton/cli.py | 4 ++-- confluence-mdx/bin/skeleton/compare.py | 4 ++-- confluence-mdx/bin/skeleton/diff.py | 4 ++-- 6 files changed, 28 insertions(+), 31 deletions(-) diff --git a/confluence-mdx/bin/convert_all.py b/confluence-mdx/bin/convert_all.py index 9be3baa35..6abccf626 100755 --- a/confluence-mdx/bin/convert_all.py +++ b/confluence-mdx/bin/convert_all.py @@ -23,19 +23,20 @@ import yaml # Resolve project root (confluence-mdx/) from this script's location -_bin_dir = str(Path(__file__).resolve().parent) -_project_root = str(Path(_bin_dir).parent) +_SCRIPT_DIR = Path(__file__).resolve().parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ # Ensure bin/ is on sys.path -if _bin_dir not in sys.path: - sys.path.insert(0, _bin_dir) +if str(_SCRIPT_DIR) not in sys.path: + sys.path.insert(0, str(_SCRIPT_DIR)) -def _resolve(path: str) -> str: - """Resolve a relative path against _project_root (confluence-mdx/).""" - if os.path.isabs(path): - return path - return os.path.join(_project_root, path) +def _resolve(rel: str) -> str: + """Resolve a relative path against _PROJECT_DIR (confluence-mdx/).""" + p = Path(rel) + if p.is_absolute(): + return rel + return str(_PROJECT_DIR / rel) def load_pages_yaml(pages_yaml_path: str) -> List[Dict]: @@ -141,7 +142,7 @@ def convert_all(pages: List[Dict], var_dir: str, output_base_dir: str, public_di os.makedirs(output_dir, exist_ok=True) cmd = [ - sys.executable, os.path.join(_bin_dir, 'converter', 'cli.py'), + sys.executable, str(_SCRIPT_DIR / 'converter' / 'cli.py'), input_file, output_file, f'--public-dir={public_dir}', f'--attachment-dir={attachment_dir}', diff --git a/confluence-mdx/bin/converter/cli.py b/confluence-mdx/bin/converter/cli.py index 3ebcce223..d48753722 100755 --- a/confluence-mdx/bin/converter/cli.py +++ b/confluence-mdx/bin/converter/cli.py @@ -17,19 +17,13 @@ import yaml # Resolve project root (confluence-mdx/) from this script's location -_bin_dir = str(Path(__file__).resolve().parent.parent) -_project_dir = str(Path(_bin_dir).parent) +# bin/converter/cli.py -> .parent=converter/ -> .parent=bin/ -> .parent=confluence-mdx/ +_SCRIPT_DIR = Path(__file__).resolve().parent.parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ # Ensure bin/ is on sys.path when run as a script (e.g. bin/converter/cli.py) -if _bin_dir not in sys.path: - sys.path.insert(0, _bin_dir) - - -def _resolve(path: str) -> str: - """Resolve a relative path against _project_dir (confluence-mdx/).""" - if os.path.isabs(path): - return path - return os.path.join(_project_dir, path) +if str(_SCRIPT_DIR) not in sys.path: + sys.path.insert(0, str(_SCRIPT_DIR)) import converter.context as ctx from converter.context import ( @@ -134,7 +128,8 @@ def main(): args = parser.parse_args() # Resolve relative paths against project root (confluence-mdx/) - args.public_dir = _resolve(args.public_dir) + if not os.path.isabs(args.public_dir): + args.public_dir = str(_PROJECT_DIR / args.public_dir) # Configure logging with the specified level log_level = getattr(logging, args.log_level.upper()) diff --git a/confluence-mdx/bin/fetch/config.py b/confluence-mdx/bin/fetch/config.py index 7b291a001..c402f0508 100644 --- a/confluence-mdx/bin/fetch/config.py +++ b/confluence-mdx/bin/fetch/config.py @@ -5,8 +5,9 @@ from pathlib import Path from typing import Optional -# Project root: confluence-mdx/ (two levels up from this file) -_PROJECT_ROOT = str(Path(__file__).resolve().parent.parent.parent) +# Resolve project root (confluence-mdx/) from this module's location +# bin/fetch/config.py -> .parent=fetch/ -> .parent=bin/ -> .parent=confluence-mdx/ +_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ @dataclass @@ -35,4 +36,4 @@ def __post_init__(self): for field in ('default_output_dir', 'cache_dir', 'translations_file'): value = getattr(self, field) if not os.path.isabs(value): - setattr(self, field, os.path.join(_PROJECT_ROOT, value)) + setattr(self, field, str(_PROJECT_DIR / value)) diff --git a/confluence-mdx/bin/skeleton/cli.py b/confluence-mdx/bin/skeleton/cli.py index 05130db96..6cddea8c3 100755 --- a/confluence-mdx/bin/skeleton/cli.py +++ b/confluence-mdx/bin/skeleton/cli.py @@ -92,8 +92,8 @@ from typing import List, Tuple, Optional # Resolve project root (confluence-mdx/) from this script's location -# bin/skeleton/cli.py -> .parent=skeleton/ -> .parent=bin/ -> .parent=confluence-mdx/ -_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ +_SCRIPT_DIR = Path(__file__).resolve().parent.parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ # Import modules for recursive processing and comparison from skeleton.compare import compare_files diff --git a/confluence-mdx/bin/skeleton/compare.py b/confluence-mdx/bin/skeleton/compare.py index 5ff62ab52..994c60e31 100644 --- a/confluence-mdx/bin/skeleton/compare.py +++ b/confluence-mdx/bin/skeleton/compare.py @@ -9,8 +9,8 @@ from pathlib import Path # Resolve project root (confluence-mdx/) from this module's location -# bin/skeleton/compare.py -> .parent=skeleton/ -> .parent=bin/ -> .parent=confluence-mdx/ -_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ +_SCRIPT_DIR = Path(__file__).resolve().parent.parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ def get_mdx_files(directory: Path) -> set[str]: diff --git a/confluence-mdx/bin/skeleton/diff.py b/confluence-mdx/bin/skeleton/diff.py index 52962207b..9a748f3c0 100644 --- a/confluence-mdx/bin/skeleton/diff.py +++ b/confluence-mdx/bin/skeleton/diff.py @@ -14,8 +14,8 @@ from typing import List, Tuple, Optional, Dict, Set # Resolve project root (confluence-mdx/) from this module's location -# bin/skeleton/diff.py -> .parent=skeleton/ -> .parent=bin/ -> .parent=confluence-mdx/ -_PROJECT_DIR = Path(__file__).resolve().parent.parent.parent # confluence-mdx/ +_SCRIPT_DIR = Path(__file__).resolve().parent.parent # confluence-mdx/bin/ +_PROJECT_DIR = _SCRIPT_DIR.parent # confluence-mdx/ try: import yaml From 5c2513557f7728a7f4213886e1a3cec08a459e7b Mon Sep 17 00:00:00 2001 From: JK Date: Fri, 13 Feb 2026 20:42:21 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20converter/cli.py=20--public-dir=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=EA=B0=92=EB=A7=8C=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=EB=A3=A8=ED=8A=B8=20=EA=B8=B0=EC=A4=80?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=ED=95=B4=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 사용자가 CLI로 명시한 --public-dir 경로는 cwd 기준 유지, 기본값(./public)만 _PROJECT_DIR 기준 절대경로로 설정. 테스트에서 상대경로로 --public-dir를 전달할 때 오작동하는 문제 수정. Co-Authored-By: Claude Opus 4.6 --- confluence-mdx/bin/converter/cli.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/confluence-mdx/bin/converter/cli.py b/confluence-mdx/bin/converter/cli.py index d48753722..6440f4797 100755 --- a/confluence-mdx/bin/converter/cli.py +++ b/confluence-mdx/bin/converter/cli.py @@ -115,7 +115,7 @@ def main(): parser.add_argument('input_file', help='Input XHTML file path') parser.add_argument('output_file', help='Output Markdown file path') parser.add_argument('--public-dir', - default='./public', + default=str(_PROJECT_DIR / 'public'), help='/public directory path') parser.add_argument('--attachment-dir', help='Directory to save attachments (default: output file directory)') @@ -127,10 +127,6 @@ def main(): help='Set the logging level (default: info)') args = parser.parse_args() - # Resolve relative paths against project root (confluence-mdx/) - if not os.path.isabs(args.public_dir): - args.public_dir = str(_PROJECT_DIR / args.public_dir) - # Configure logging with the specified level log_level = getattr(logging, args.log_level.upper()) logging.basicConfig(level=log_level, format='%(levelname)s - %(funcName)s:%(lineno)d - %(message)s')