-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: copy .env file error on Windows os. #9
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Thanks! Checking... |
Welcome to Codecov πOnce you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered βοΈ |
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.
@@ -185,3 +186,23 @@ func (receiver *NewCommand) removeFiles(path string) error { | |||
// Remove the .GitHub directory | |||
return file.Remove(filepath.Join(path, ".github")) | |||
} | |||
|
|||
func (receiver *NewCommand) copyFile(inputFilePath, outputFilePath string) (err error) { |
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.
Please add a test case for this function.
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.
I have updated the unit tests. Please check them out.
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.
Thanks! Two nitpicks.
console/commands/new_command_test.go
Outdated
// Test copyFile | ||
src := filepath.Join("example-app", ".env.example") | ||
dst := filepath.Join("example-app", ".env") | ||
assert.Nil(t, newCommand.copyFile(src, dst)) | ||
assert.True(t, file.Exists(dst)) |
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.
This can be moved to a new function: TestCopyFile
.
@@ -47,6 +48,12 @@ func TestNewCommand(t *testing.T) { | |||
assert.Contains(t, captureOutput, "App key generated successfully!") | |||
assert.True(t, file.Exists("example-app")) |
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.
assert.True(t, file.Exists("example-app")) | |
assert.True(t, file.Exists("example-app")) | |
assert.True(t, file.Exists("example-app/.env")) |
I have updated the unit tests. Please check them out. Thank you for your review. |
assert.True(t, file.Exists(src)) | ||
assert.Nil(t, newCommand.copyFile(src, dst)) | ||
assert.True(t, file.Exists(dst)) | ||
assert.Nil(t, os.Remove(dst)) |
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.
Please remove src
, too.
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.
sure!
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.
Great PR, thanks for your contribution! will add you to the list. π
Hey @jeff87218 We created a private channel in Discord for contributors. You can click the link and DM me (@bowen) to join it if you are interested. Here you can:
|
π Description
Replace the command with Go code for greater portability.
Closes goravel/goravel#461
@coderabbitai summary
β Checks