Skip to content

Commit 9c5df5a

Browse files
GitHub Copilot CLICopilot
andcommitted
Fix setup permissions for bind-mounted session paths
Initialize ownership for /home/vscode/.local and ~/.opencode before uv install and ECC setup so CI/devcontainer postCreate works with bind mounts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9ee5681 commit 9c5df5a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.devcontainer/setup.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ if [ ${#INSTALL_PIDS[@]} -gt 0 ]; then
9191
done
9292
fi
9393

94+
# bind mount 環境では /home/vscode/.local や ~/.opencode が root 所有になるため先に補正
95+
echo "🔒 ホーム配下ディレクトリ権限を初期化中..."
96+
sudo mkdir -p /home/vscode/.local /home/vscode/.local/bin /home/vscode/.opencode 2>/dev/null || true
97+
sudo chown -R vscode:vscode /home/vscode/.local /home/vscode/.opencode 2>/dev/null || \
98+
chown -R vscode:vscode /home/vscode/.local /home/vscode/.opencode 2>/dev/null || true
99+
94100
# Pythonツール管理用 uv の準備
95101
if ! command -v uv &> /dev/null; then
96102
echo "🐍 uv をインストール中..."
@@ -109,7 +115,8 @@ echo " ECC設定を適用中..."
109115

110116
# .opencode ディレクトリ権限修正(EACCES エラー対策)
111117
echo " 🔒 .opencode ディレクトリ権限設定中..."
112-
mkdir -p ~/.opencode ~/.opencode/.agents ~/.opencode/.agents/skills
118+
sudo mkdir -p ~/.opencode ~/.opencode/.agents ~/.opencode/.agents/skills 2>/dev/null || \
119+
mkdir -p ~/.opencode ~/.opencode/.agents ~/.opencode/.agents/skills
113120
sudo chown -R vscode:vscode ~/.opencode 2>/dev/null || chown -R vscode:vscode ~/.opencode 2>/dev/null || true
114121
chmod -R 755 ~/.opencode 2>/dev/null || true
115122

0 commit comments

Comments
 (0)