-
Notifications
You must be signed in to change notification settings - Fork 31
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
XVM Base - minimal implement #60
Conversation
Sunrisepeak
commented
Dec 28, 2024
•
edited
Loading
edited
- [Features]: Xlings Version Manager | XVM Base #13
core/xvm/src/helper.rs
Outdated
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.
let mut workspace = if ...
core/xvm/src/cmdprocessor.rs
Outdated
let mut program = shims::Program::new(target, version); | ||
let vdb = xvmlib::get_versiondb(); | ||
let vdata = vdb | ||
.get_vdata(target, version) | ||
.expect("Version data not found"); | ||
|
||
program.set_vdata(vdata); |
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.
Try to unify vdata
to shims initialization.
Such set_vdata is vulnerable.
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.
input(env, path, ...) - > program < - > vdata. vdata is a data-format, but isnot necessary
core/xvm/src/cmdprocessor.rs
Outdated
let vdb = xvmlib::get_versiondb(); | ||
|
||
if vdb.get_vdata(target, version).is_none() { | ||
panic!("Version not found"); |
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.
panic
will suddenly interrupt all program, it won't return an IO error.
name: String, | ||
version: String, | ||
filename: Option<String>, | ||
path: String, |
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.
you should use PathBuf
for file path.
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.
todo
minial implement for xvm:
TODO:
|
xvm cannot modify env for current shell/cmd, |
将xvm写成sh文件 文件里调用真正的xvm二进制 二进制文件处理时将需要执行的命令写入另一个文件 然后在sh文件的末尾检测并执行文件?
修改 prompt (也就是shell命令前的用来显示用户名、路径、信息的) 或者 直接 alias cd? |
No way for automatic detection. Because CLI is passive, and you can only do something by user calling. So workspace should be project oriented and not suitable for a general env control, you need to develop a |