-
Notifications
You must be signed in to change notification settings - Fork 18
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
Draft: feat: alias support prefix #442
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #442 +/- ##
==========================================
- Coverage 95.73% 95.70% -0.03%
==========================================
Files 44 44
Lines 6278 6282 +4
==========================================
+ Hits 6010 6012 +2
- Misses 268 270 +2 ☔ View full report in Codecov by Sentry. |
d338461
to
4fe2cb3
Compare
protocol = aliases[protocol]["protocol"] | ||
path = "%s://%s" % (protocol, path_without_protocol) | ||
path = "%s://%s%s" % (protocol, prefix, path_without_protocol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉这个 prefix 可能会引发客服问题,用户可能不知道后面留几个斜杠,不同的协议可能还不一样,比如有人填的是 sftp://ubuntu@host
,正确的应该填 sftp://ubuntu@host//
吧,还有相对路径和绝对路径不知道有没有影响,🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我自己写也容易写错,但感觉这个并不是 alias 引发的,是 sftp 咱可能定义的太奇怪了
偷偷帮用户补一个 / 感觉也容易有坑,所以我就 bypass 直接传了
你觉得这里应该用 join 吗?比如没写 / 自动补一个?
- sftp://ubuntu@host = sftp://ubuntu@host/
- sftp://ubuntu@host/ = sftp://ubuntu@host/
- sftp://ubuntu@host// = sftp://ubuntu@host//
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
搞个 sftp config 文件会不会好点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
先标成 draft 吧,再想想咋整
支持一下在 alias 里写 prefix,方便给一些常用的 sftp host 加个 alias