chinus-tools 1.0.5__py3-none-any.whl → 1.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,20 @@
1
1
  import subprocess
2
2
 
3
3
 
4
- def get_modified_items() -> str:
4
+ def get_modified_items() -> bool:
5
5
  """
6
- Git 상태를 확인하여 수정된 최상위 폴더 또는 파일의 목록을 공백으로 구분된 문자열로 반환합니다.
7
-
8
- Returns:
9
- str: 수정된 최상위 폴더 또는 파일들의 공백으로 구분된 문자열.
6
+ Git 상태를 확인하여 변경 사항의 존재 유무에 따라 True/False를 반환합니다
10
7
  """
11
- # 'git status --porcelain'으로 변경 사항이 있는지 확인
12
- result = subprocess.run(['git', 'status', '--porcelain'], capture_output=True, text=True)
13
-
14
- # 결과 파싱
15
- modified_items = set()
16
- for line in result.stdout.strip().splitlines():
17
- # 변경된 파일 경로는 번째 컬럼부터 나옴
18
- file_path = line[3:].strip()
19
- # 최상위 폴더 또는 파일 추출
20
- top_level_item = file_path.split('/')[0]
21
- modified_items.add(top_level_item)
22
-
23
- # 공백으로 구분된 문자열로 변환
24
- return ' '.join(sorted(modified_items))
8
+ try:
9
+ # 'git status --porcelain'으로 변경 사항이 있는지 확인
10
+ result = subprocess.run(['git', 'status', '--porcelain'], capture_output=True, text=True, check=True)
11
+ # 출력 결과가 있으면 True (변경 사항 있음), 없으면 False (변경 사항 없음)
12
+ return bool(result.stdout.strip())
13
+ except subprocess.CalledProcessError as e:
14
+ # Git 명령 실행 실패 예외 처리
15
+ print(f"Git 명령 실행 중 오류 발생: {e}")
16
+ return False
17
+ except FileNotFoundError:
18
+ # Git 명령이 없는 경우 예외 처리
19
+ print("Git이 설치되어 있지 않거나 경로에 없습니다.")
20
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chinus_tools
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: This is a chinus Python package.
5
5
  Author-email: Chinu9653 <juyoung9653@gmail.com>
6
6
  License: MIT
@@ -1,14 +1,14 @@
1
1
  chinus_tools/__init__.py,sha256=yD2nSKvGXbGLkQw62a173X3qfsFYvP1pAdLVpnq0yFI,483
2
2
  chinus_tools/jsons.py,sha256=ULkOD-2gZxIYc8VDiCTGsSHovw2-tkE7-iZXTqESZPk,460
3
3
  chinus_tools/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- chinus_tools/git/status.py,sha256=ja9d1pHRO53iXgQvQBoWIgY70-HM4VZkrEAIQGAy4l8,941
4
+ chinus_tools/git/status.py,sha256=YHlVXqiCM-Le-ALX6H3KqbYNjdim-TSArH420ioJDu8,895
5
5
  chinus_tools/paths/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  chinus_tools/paths/get/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  chinus_tools/paths/get/absolute_path.py,sha256=zzdbBUJj0yPlY0xPD_0bV0YWQ46NvW4TyRqyIz2Y6jk,291
8
8
  chinus_tools/paths/get/project_root.py,sha256=eeY4NxPem9R2dGw2d-yERuCshc7p8eSaP0aQr1JDVVk,1196
9
9
  chinus_tools/print_input_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  chinus_tools/print_input_utils/multi_line_io.py,sha256=MG2fIUfql3727ZjY06CSN8qGSLM01wkP5UI8wAVgp8A,158
11
- chinus_tools-1.0.5.dist-info/METADATA,sha256=snKqpf7lB5N27XoN186ALVupnwRiypGf5n1w44lljvo,672
12
- chinus_tools-1.0.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
- chinus_tools-1.0.5.dist-info/top_level.txt,sha256=6U_IGf0KxJr6X8UUe-ttqvfqr80YuxwB4hhtinXzO_w,13
14
- chinus_tools-1.0.5.dist-info/RECORD,,
11
+ chinus_tools-1.0.7.dist-info/METADATA,sha256=u6at9wUIV5o3XEscnc9MXtDXESC52wmD7ksVbv8Z2RY,672
12
+ chinus_tools-1.0.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
+ chinus_tools-1.0.7.dist-info/top_level.txt,sha256=6U_IGf0KxJr6X8UUe-ttqvfqr80YuxwB4hhtinXzO_w,13
14
+ chinus_tools-1.0.7.dist-info/RECORD,,