mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-01 14:21:19 +00:00
* Escape single quotes and spaces in the path of neofetch fed as an argument to bash.exe in "pre_install" property
Many windows usernames contain spaces or single quotes/apostrophe. I accidentally have an apostrophe (') in my username. As a result neofetch fails to run as mentioned in detail [here](https://github.com/dylanaraps/neofetch/issues/2002#issue-1084846469)
I discovered that the fix to this issue is to surround the path of the neofetch script being passed as an argument to bash.exe in double-quotes. This would escape spaces and single quotes in username. Windows does not allow double quotes or backslashes in usernames, so there is no need to consider those.
This is the updated working script: https://pastebin.com/J0zTeNAw
I tried to escape my double quotes in the json file with backslashes, please check if it corresponds to my intent.
* Update neofetch.json
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
24 lines
1.1 KiB
JSON
24 lines
1.1 KiB
JSON
{
|
|
"version": "7.1.0",
|
|
"description": "A command-line system information tool written in bash 3.2+.",
|
|
"homepage": "https://github.com/dylanaraps/neofetch",
|
|
"license": "MIT",
|
|
"suggest": {
|
|
"git": [
|
|
"git",
|
|
"git-with-openssh"
|
|
]
|
|
},
|
|
"url": "https://raw.githubusercontent.com/dylanaraps/neofetch/7.1.0/neofetch",
|
|
"hash": "3dc33493e54029fb1528251552093a9f9a2894fcf94f9c3a6f809136a42348c7",
|
|
"pre_install": [
|
|
"if(installed 'git-with-openssh') { $git = 'git-with-openssh' } else { $git = 'git' }",
|
|
"Write-Output \"`$GitDir = (Get-Item (scoop which $git) -ErrorAction:Stop).Directory.Parent; if (`$GitDir.FullName -imatch 'mingw') { `$GitDir = `$GitDir.Parent }; & (Join-Path (Join-Path `$GitDir.FullName 'bin') 'bash.exe') `\"`$(Join-Path `$PSScriptRoot 'neofetch')`\" @args\" | Out-File \"$dir\\neofetch.ps1\" -Encoding utf8"
|
|
],
|
|
"bin": "neofetch.ps1",
|
|
"checkver": "github",
|
|
"autoupdate": {
|
|
"url": "https://raw.githubusercontent.com/dylanaraps/neofetch/$version/neofetch"
|
|
}
|
|
}
|