Skip to content
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

[2.0.0] 커밋 방지 처리 스크립트 추가 #98

Merged
merged 10 commits into from
Feb 1, 2024
Merged
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