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

[email protected]: update cmd shim to call git's bash.exe instead of wsl's … #13342

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[email protected]: update cmd shim to call git's bash.exe instead of wsl's …
…bash.exe
  • Loading branch information
ykhan21 committed May 24, 2024
commit b77625040ee132d9333bc881a192735a38f29b95
48 changes: 47 additions & 1 deletion bucket/ani-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
"description": "A cli to browse and watch anime (alone AND with friends). This tool scrapes the site allanime.",
"homepage": "https://github.com/pystardust/ani-cli",
"license": "GPL-3.0-or-later",
"notes": [
"Fetch the latest version of ani-cli from the master branch with 'ani-cli -U'.",
"If you encounter an issue, make sure you are on latest version by running 'ani-cli -U'. If after this the issue persists then open an issue."
],
"suggest": {
"git": "git",
"fzf": "fzf",
"wget": "wget",
"aria2": "aria2",
"mpv": "extras/mpv",
"ffmpeg": [
Expand All @@ -16,6 +19,49 @@
},
"url": "https://github.com/pystardust/ani-cli/releases/download/v4.8/ani-cli",
"hash": "4a21690493b4aee4165f1881b19d9d696c9f56c5687940e587c542c6caa7c6fe",
"post_install": [
"$cmd_shim = \"$scoopdir\\shims\\ani-cli.cmd\"",
"",
"if ( !(Test-Path $cmd_shim) ) { exit 0 }",
"",
"$candidates = @(",
" \"$env:GIT_INSTALL_ROOT\\bin\\bash.exe\",",
" \"C:\\Program Files\\Git\\bin\\bash.exe\",",
" \"$scoopdir\\apps\\git\\current\\bin\\bash.exe\"",
")",
"",
"$formatted_candidates = $candidates -join ', '",
"",
"info \"Finding a non-WSL bash.exe at one of these locations: $formatted_candidates\"",
"",
"$selected = $null",
"",
"foreach ($c in $candidates) {",
" if (Test-Path \"$c\") {",
" info \"Found a non-WSL bash.exe at ($c)\"",
" $selected = \"$c\"",
" break",
" }",
"}",
"",
"if (!$selected) {",
" error \"Please uninstall ani-cli with 'scoop uninstall ani-cli'. Install Git for Windows (with 'scoop install git' or by any other means) before reinstalling ani-cli.\"",
" exit 1",
"}",
"",
"info \"Updating ($cmd_shim) to call ($selected) instead of WSL's bash.\"",
"",
"(Get-Content $cmd_shim) -replace \"^@bash\", \"@\"\"$selected\"\"\" | Set-Content $cmd_shim",
"",
"info \"Updating ani-cli with 'ani-cli -U'.\"",
"ani-cli -U",
"",
"$successful_exit = $?",
"if (!$successful_exit) {",
" error \"ani-cli update failed. Please raise an issue here: 'https://github.com/pystardust/ani-cli/issues/new/choose'.\"",
" exit 1",
"}"
],
"bin": "ani-cli",
"checkver": "github",
"autoupdate": {
Expand Down