-
-
Notifications
You must be signed in to change notification settings - Fork 267
在Windows平台上使用PowerShell替代sed和grep命令来处理uv配置文件 #328
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
base: dev
Are you sure you want to change the base?
Conversation
通过PowerShell命令实现Windows平台上的文件操作, 替代原有的sed和grep命令,确保uv配置文件在Windows 环境下能够正确设置源地址。
在Windows平台上使用PowerShell替代sed和grep命令来处理uv配置文件
|
❤️ 感谢你的贡献!我们将在最少半小时,最多5天内阅读此 PR 并回复你 |
你可以大声自豪地说这一点! 这个 PR 我很喜欢,因为它质量很高,运用 这个 PR 直击痛点,把悬而未决两个多月的几个问题给解决了 👍👍👍 你提到这是你 第1个正式的PR,这也让我非常开心,因为这是建设
Windows 上使用 |
|
最后,你需要再提交一次,把自己的贡献记录进
然后把时间给更新一下 |
添加新贡献者MingriLingran,修复 Windows 平台 uv 配置获取
|
非常感谢您的认可,我已经更新了贡献值列表 |
|
🤝 |
在Windows平台上使用PowerShell替代sed和grep命令来处理uv配置文件
问题描述
修复:#318
修复:#308
修复:使用get uv命令不可用的问题
方案与实现
替换 grep 命令检测 [[index]] 配置段
powershell -Command "if (Get-Content @f@ | Select-String '^\[\[index\]\]$') { exit 0 } else { exit 1 }"替换 sed 命令修改 url 配置段:
powershell -Command "$content = Get-Content '@f@'; $content = $content -replace '^url = \".*\"$', 'url = \"@url@\"'; $content | Set-Content '@f@'"换 grep 命令检测 [[index]] 配置段,使用pwsh直接输出文件内容
powershell -Command "Get-Content '@f@'"PS:(超大声的说)这应该是我在GitHub第1个正式的PR(超开心)