Skip to content

Commit b6b764d

Browse files
committed
docs: support JSONC config variant in installation instructions
1 parent 4b6b725 commit b6b764d

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

README.ko.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,21 @@ OpenCode가 설치되어 있지 않다면, [OpenCode 설치 가이드](https://o
149149
```bash
150150
mkdir -p ~/.config/opencode
151151

152-
if [ -f ~/.config/opencode/opencode.json ]; then
152+
CONFIG_FILE=""
153+
if [ -f ~/.config/opencode/opencode.jsonc ]; then
154+
CONFIG_FILE=~/.config/opencode/opencode.jsonc
155+
elif [ -f ~/.config/opencode/opencode.json ]; then
156+
CONFIG_FILE=~/.config/opencode/opencode.json
157+
fi
158+
159+
if [ -n "$CONFIG_FILE" ]; then
153160
# 기존 설정 파일이 있는 경우: jq 또는 python으로 plugin 추가
154161
if command -v jq &> /dev/null; then
155162
jq '.plugin = ((.plugin // []) + ["oh-my-opencode"] | unique)' \
156-
~/.config/opencode/opencode.json > /tmp/oc.json && \
157-
mv /tmp/oc.json ~/.config/opencode/opencode.json
163+
"$CONFIG_FILE" > /tmp/oc.json && \
164+
mv /tmp/oc.json "$CONFIG_FILE"
158165
else
159-
echo "~/.config/opencode/opencode.json의 plugin 배열에 \"oh-my-opencode\"를 추가하세요"
166+
echo "$CONFIG_FILE plugin 배열에 \"oh-my-opencode\"를 추가하세요"
160167
fi
161168
else
162169
# 새 설정 파일 생성
@@ -168,7 +175,7 @@ fi
168175

169176
```bash
170177
opencode --version # 1.0.132 이상이어야 함
171-
cat ~/.config/opencode/opencode.json # plugin 배열에 "oh-my-opencode"가 있어야 함
178+
cat ~/.config/opencode/opencode.json 2>/dev/null || cat ~/.config/opencode/opencode.jsonc # plugin 배열에 "oh-my-opencode"가 있어야 함
172179
```
173180

174181
### 4단계: 인증정보 설정

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,21 @@ If OpenCode isn't installed, check the [OpenCode Installation Guide](https://ope
150150
```bash
151151
mkdir -p ~/.config/opencode
152152

153-
if [ -f ~/.config/opencode/opencode.json ]; then
153+
CONFIG_FILE=""
154+
if [ -f ~/.config/opencode/opencode.jsonc ]; then
155+
CONFIG_FILE=~/.config/opencode/opencode.jsonc
156+
elif [ -f ~/.config/opencode/opencode.json ]; then
157+
CONFIG_FILE=~/.config/opencode/opencode.json
158+
fi
159+
160+
if [ -n "$CONFIG_FILE" ]; then
154161
# Existing config: add plugin using jq or python
155162
if command -v jq &> /dev/null; then
156163
jq '.plugin = ((.plugin // []) + ["oh-my-opencode"] | unique)' \
157-
~/.config/opencode/opencode.json > /tmp/oc.json && \
158-
mv /tmp/oc.json ~/.config/opencode/opencode.json
164+
"$CONFIG_FILE" > /tmp/oc.json && \
165+
mv /tmp/oc.json "$CONFIG_FILE"
159166
else
160-
echo "Please add \"oh-my-opencode\" to the plugin array in ~/.config/opencode/opencode.json"
167+
echo "Please add \"oh-my-opencode\" to the plugin array in $CONFIG_FILE"
161168
fi
162169
else
163170
# Create new config
@@ -169,7 +176,7 @@ fi
169176

170177
```bash
171178
opencode --version # Should be 1.0.132 or higher
172-
cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode" in plugin array
179+
cat ~/.config/opencode/opencode.json 2>/dev/null || cat ~/.config/opencode/opencode.jsonc # Should contain "oh-my-opencode" in plugin array
173180
```
174181

175182
### Step 4: Configure Authentication

0 commit comments

Comments
 (0)