-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: added file.write #1293
feat: added file.write #1293
Conversation
Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
kclvm/runtime/src/file/mod.rs
Outdated
} | ||
return ValueRef::none().into_raw(ctx); | ||
} else { | ||
panic!("Failed to create 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.
Pls output the create error message.
Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
kclvm/runtime/src/file/mod.rs
Outdated
|
||
if let Some(path) = get_call_arg_str(args, kwargs, 0, Some("filepath")) { | ||
if let Some(content) = get_call_arg_str(args, kwargs, 1, Some("content")) { | ||
if let Ok(mut file) = fs::File::create(&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.
if let Ok(mut file) = fs::File::create(&path) { | |
match fs::File::create(&path) {Ok(...), Err(...)} |
Signed-off-by: JeevaRamanathan <64531160+JeevaRamanathan@users.noreply.github.com>
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.
LGTM
Pull Request Test Coverage Report for Build 8988636367Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
Fixes Extend file module functions (for smoother GitOps) #1267
2. What is the scope of this PR (e.g. component or file name):
kcl-lang/kcl/kclvm
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links: