Skip to content

Commit 7bdbdda

Browse files
committed
Set env variable if Scoop has installed git
1 parent 8ad4b4e commit 7bdbdda

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

bucket/claude-code.json

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
11
{
2-
"version": "1.0.107",
2+
"version": "1.0.108",
33
"description": "An agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows.",
44
"homepage": "https://www.anthropic.com/claude-code",
55
"license": {
66
"identifier": "Proprietary",
77
"url": "https://www.anthropic.com/legal/commercial-terms"
88
},
9+
"suggest": {
10+
"git": "main/git"
11+
},
912
"architecture": {
1013
"64bit": {
11-
"url": "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/1.0.107/win32-x64/claude.exe",
12-
"hash": "1f3e0a13f45ffb6b96b688f47766b7be8a8e7335d8e38a0677ccd7dee7d6f5b4"
14+
"url": "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/1.0.108/win32-x64/claude.exe",
15+
"hash": "94345a76febd94108beb3b1023eab12993359f2855d77b0abe51e2f79731b779"
1316
}
1417
},
15-
"env_set": {
16-
"CLAUDE_CODE_GIT_BASH_PATH": "$scoopdir\\shims\\bash.exe"
17-
},
18+
"post_install": [
19+
"$GitBashPath = [string] '{0}\\shims\\bash.exe' -f $scoopdir",
20+
"$EnvVarName = [string] 'CLAUDE_CODE_GIT_BASH_PATH'",
21+
"if (",
22+
" [System.IO.File]::Exists($GitBashPath) -and",
23+
" [string]::IsNullOrWhiteSpace(([System.Environment]::GetEnvironmentVariable($EnvVarName, 'User')))",
24+
") {",
25+
" 'User','Process' | ForEach-Object -Process {",
26+
" [System.Environment]::SetEnvironmentVariable($EnvVarName, $GitBashPath, $_)",
27+
" }",
28+
"}",
29+
"if (",
30+
" [string]::IsNullOrWhiteSpace(([System.Environment]::GetEnvironmentVariable($EnvVarName, 'User')))",
31+
") {",
32+
" info ('Claude Code requires environment variable \"{0}\" to be set to git bash.' -f $EnvVarName)",
33+
"}"
34+
],
1835
"bin": "claude.exe",
1936
"shortcuts": [
2037
[
@@ -23,6 +40,16 @@
2340
]
2441
],
2542
"post_uninstall": [
43+
"# Clean up environment variable if set to git installed by Scoop",
44+
"$GitBashPath = [string] '{0}\\shims\\bash.exe' -f $scoopdir",
45+
"$EnvVarName = [string] 'CLAUDE_CODE_GIT_BASH_PATH'",
46+
"$Scopes = [string[]]('Process', 'User')",
47+
"foreach ($Scope in $Scopes) {",
48+
" if ([System.Environment]::GetEnvironmentVariable($EnvVarName, $Scope) -eq $GitBashPath) {",
49+
" [System.Environment]::SetEnvironmentVariable($EnvVarName, $null, $Scope)",
50+
" }",
51+
"}",
52+
"# Purge",
2653
"if ($purge) {",
2754
" $Directories = [string[]](",
2855
" [System.IO.Path]::Combine($env:LOCALAPPDATA,'claude-cli-nodejs'),",

0 commit comments

Comments
 (0)