-
Notifications
You must be signed in to change notification settings - Fork 36
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
adding an event for modifying shell configuration file #110
Conversation
Signed-off-by: h4l0gen <[email protected]>
Signed-off-by: Kapil Sharma <[email protected]>
Signed-off-by: Kapil Sharma <[email protected]>
@FedeDP this rule is triggered successfully. It is modifying .bashrc file by just adding a comment which is clearly specified that it is written by event-generator without giving harm to other file content. |
Once again, I'd avoid touching user configuration files even if it has no side effects nor harm. |
Yes @FedeDP It should trigger rule. Thanks for advice, I will make changes. |
return err | ||
} | ||
|
||
configFile := filepath.Join(homeDir, ".bashrc") |
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.
We are still modifying $HOME/.bashrc
here right?
Signed-off-by: Kapil Sharma <[email protected]>
@FedeDP changes are done. And as expected rule triggered successfully |
|
||
// Modify the file | ||
content := []byte("# written by event-generator\n") | ||
err = os.WriteFile(tmpConfigFile, content, 0644) |
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.
os.WriteFile
already creates the file for us !
Thus we can skip the file creation step ;)
Signed-off-by: Kapil Sharma <[email protected]>
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.
/approve
LGTM label has been added. Git tree hash: 5319889a0e74ef4c74a9f874d91885d3c10cc59d
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, h4l0gen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area events
What this PR does / why we need it:
this PR trigger rule
modify shell configuration file
Which issue(s) this PR fixes:
Fixes #107
Special notes for your reviewer: