Skip to content

Commit

Permalink
[2.0.0] 커밋 방지 처리 스크립트 추가 (#98)
Browse files Browse the repository at this point in the history
* [추가] 커밋 방지 처리 스크립트 추가

* [수정] 쿠링맵 사용시 API 호스트를 info.plist 에서 가져오도록 수정
  • Loading branch information
x-0o0 authored Feb 1, 2024
1 parent d1974a1 commit 241600c
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 6 deletions.
21 changes: 21 additions & 0 deletions .github/scripts/Commit_Guardian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
TARGET_FILES=("package-kuring/Sources/UIKit/CampusUI/Resources/KuringMaps-Info.plist" "package-kuring/Sources/Networks/Resources/KuringLink-Info.plist")

echo "🩺 커밋 방지 필요 여부 체크 중"

GUARDED_FILES=($(git ls-files -v | grep '^h'))

if [ ${#TARGET_FILES[@]} -gt 0 ]; then
echo "✅ 커밋 방지 처리가 되어있습니다"
exit 0
else
echo "💊 커밋 방지 코드를 실행합니다"
fi

cd ../..

for TARGET_FILE in "${TARGET_FILES[@]}"; do
git update-index --assume-unchanged $TARGET_FILE
done

echo "✅ 커밋 방지 처리가 완료되었습니다"
5 changes: 5 additions & 0 deletions FIRST_ACTION.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cd .github/scripts/
chmod +x Commit_Guardian.sh
./Commit_Guardian.sh
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@

## 시작 가이드

### 커밋 방지 처리

> **Important**: 매우 중요한 단계입니다. 클론 후 즉시 실행하십시오.
루트 폴더 경로에서 `FIRST_ACTION.sh` 스크립트를 실행합니다.
```bash
./FIRST_ACTION.sh
```
만약 권한 에러가 발생할 경우 아래 명령어를 실행하고 다시 스크립트를 실행합니다.
```bash
chmod +x FIRST_ACTION.sh
```

### 패키지 기반 모듈화 (Package Based Modularization)

`KuringApp.xcodeproj` 열기
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>API_HOST</key>
<string>🔐</string>
<key>USING_HTTPS</key>
<true/>
<false/>
</dict>
</plist>
26 changes: 21 additions & 5 deletions package-kuring/Sources/UIKit/CampusUI/CampusApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,33 @@ import KuringMapsUI
public struct CampusApp: View {
private let appearance = Appearance()

private var linkHost: String {
guard let plistURL = Bundle.module.url(forResource: "KuringMaps-Info", withExtension: "plist") else {
return ""
}
let dict = try? NSDictionary(contentsOf: plistURL, error: ())
let apiHost = dict?["API_HOST"] as? String
return apiHost ?? ""
}
private var libHost: String {
guard let plistURL = Bundle.module.url(forResource: "KuringMaps-Info", withExtension: "plist") else {
return ""
}
let dict = try? NSDictionary(contentsOf: plistURL, error: ())
let libraryConfig = dict?["Library Configuration"] as? [String: String]
let apiHost = libraryConfig?["API_HOST"]
return apiHost ?? ""
}

public var body: some View {
KuringMap(
linkConfig: .init(host: ""),
libConfig: .init(host: "")
linkConfig: .init(host: linkHost),
libConfig: .init(host: libHost)
)
.environment(\.mapAppearance, appearance)
}

public init() {

}
public init() { }
}

#Preview {
Expand Down

0 comments on commit 241600c

Please sign in to comment.