Skip to content

Commit 1580669

Browse files
kiyotisclaude
andcommitted
feat: Add environment variable support to setup scripts
Add NABLEDGE_REPO and NABLEDGE_BRANCH environment variables to both setup scripts: - NABLEDGE_REPO: Repository path (default: nablarch/nabledge) - NABLEDGE_BRANCH: Branch name (default: main) This enables: - Testing with test-to branch - Using forked repositories - Custom corporate deployments Updated README with usage examples for both Claude Code and GitHub Copilot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc2c35e commit 1580669

4 files changed

Lines changed: 43 additions & 7 deletions

File tree

‎.claude/skills/nabledge-6/plugin/CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
### Added
10+
- Environment variable support for setup scripts (`NABLEDGE_REPO`, `NABLEDGE_BRANCH`) to enable testing and custom repository usage
11+
912
### Changed
1013
- Clarified installation prerequisites in README (Claude Code requires CC installed, GitHub Copilot requires WSL or GitBash)
1114

‎.claude/skills/nabledge-6/plugin/README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ curl -sSL https://raw.githubusercontent.com/nablarch/nabledge/main/setup-6-cc.sh
5353

5454
**注**: セットアップスクリプトは必要に応じて `jq` コマンドを自動インストールします(Linux/WSL/GitBash環境)。macOSでは手動インストールが必要です(`brew install jq`)。
5555

56+
**環境変数でカスタマイズ** (オプション):
57+
58+
```bash
59+
# テストブランチを使用する場合
60+
NABLEDGE_BRANCH=test-to curl -sSL https://raw.githubusercontent.com/nablarch/nabledge/main/setup-6-cc.sh | bash
61+
62+
# フォーク版を使用する場合
63+
NABLEDGE_REPO=mycompany/nabledge-fork NABLEDGE_BRANCH=custom curl -sSL https://raw.githubusercontent.com/mycompany/nabledge-fork/custom/setup-6-cc.sh | bash
64+
```
65+
5666
### GitHub Copilot
5767

5868
**前提条件**: WSL または GitBash 環境
@@ -70,6 +80,16 @@ curl -sSL https://raw.githubusercontent.com/nablarch/nabledge/main/setup-6-ghc.s
7080

7181
**注**: セットアップスクリプトは必要に応じて `jq` コマンドを自動インストールします(Linux/WSL/GitBash環境)。macOSでは手動インストールが必要です(`brew install jq`)。
7282

83+
**環境変数でカスタマイズ** (オプション):
84+
85+
```bash
86+
# テストブランチを使用する場合
87+
NABLEDGE_BRANCH=test-to curl -sSL https://raw.githubusercontent.com/nablarch/nabledge/main/setup-6-ghc.sh | bash
88+
89+
# フォーク版を使用する場合
90+
NABLEDGE_REPO=mycompany/nabledge-fork NABLEDGE_BRANCH=custom curl -sSL https://raw.githubusercontent.com/mycompany/nabledge-fork/custom/setup-6-ghc.sh | bash
91+
```
92+
7393
## 使い方
7494

7595
### 基本的な使い方

‎scripts/setup-6-cc.sh‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ fi
1111
echo "Setting up Nabledge-6 plugin for Claude Code..."
1212
echo "Project root: $PROJECT_ROOT"
1313

14-
# Configuration
15-
REPO_OWNER="nablarch"
16-
REPO_NAME="nabledge"
17-
BRANCH="main"
14+
# Configuration (can be overridden with environment variables)
15+
NABLEDGE_REPO="${NABLEDGE_REPO:-nablarch/nabledge}"
16+
NABLEDGE_BRANCH="${NABLEDGE_BRANCH:-main}"
17+
18+
# Parse repository owner and name from NABLEDGE_REPO
19+
REPO_OWNER="${NABLEDGE_REPO%/*}"
20+
REPO_NAME="${NABLEDGE_REPO#*/}"
21+
BRANCH="$NABLEDGE_BRANCH"
1822
MARKETPLACE_NAME="nabledge"
1923
PLUGIN_NAME="nabledge-6"
2024

25+
echo "Repository: $NABLEDGE_REPO"
26+
echo "Branch: $BRANCH"
27+
2128
# Create .claude directory if it doesn't exist
2229
mkdir -p "$PROJECT_ROOT/.claude"
2330

‎scripts/setup-6-ghc.sh‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ fi
1111
echo "Setting up Nabledge-6 skill for GitHub Copilot..."
1212
echo "Project root: $PROJECT_ROOT"
1313

14-
# Download nabledge-6 plugin from nablarch/nabledge repository
15-
REPO_URL="https://github.com/nablarch/nabledge"
16-
BRANCH="main"
14+
# Configuration (can be overridden with environment variables)
15+
NABLEDGE_REPO="${NABLEDGE_REPO:-nablarch/nabledge}"
16+
NABLEDGE_BRANCH="${NABLEDGE_BRANCH:-main}"
17+
18+
# Build repository URL
19+
REPO_URL="https://github.com/${NABLEDGE_REPO}"
20+
BRANCH="$NABLEDGE_BRANCH"
1721
TEMP_DIR=$(mktemp -d)
1822

23+
echo "Repository: $NABLEDGE_REPO"
24+
echo "Branch: $BRANCH"
1925
echo "Downloading nabledge-6 plugin from $REPO_URL (branch: $BRANCH)..."
2026
cd "$TEMP_DIR"
2127
git clone --depth 1 --filter=blob:none --sparse --branch "$BRANCH" "$REPO_URL"

0 commit comments

Comments
 (0)