Closed e-gineer closed 1 year ago
Hey @e-gineer I would like to work on this . Can you please guide me how to do this?
Hey @SaumyaBhushan thanks for that.
The mod init is performed by this function: https://github.com/turbot/steampipe/blob/f80f9c1b21b9a3d8edc6c54b5f4de15d29bef55b/cmd/mod.go#L215
I suggest adding a function verifyModLocation
which returns a bool indicating whether to proceed.
verifyModLocation
should to be called before CreateDefaultMod
You could move the existing mod checking into this function:
if parse.ModfileExists(workspacePath) {
fmt.Println("Working folder already contains a mod definition file")
return
}
Then after that, add the checking described by the issue. If:
'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
'This issue was closed because it has been stalled for 90 days with no activity.'
Hello, I'd like to work on this issue, thanks for the description/breaking it down
https://github.com/Aaronstotle/steampipe_mod_init/commit/fac993ccd4ecbc3ee2d45471bc35b53ccc0e70bc
So I have a basic function here that will trigger when I run this in my home directory, however I'm not sure how I stop make the program stop and confirm for the user
We've seen a few users accidentally run
steampipe mod init
in their home directory, which then causes steampipe commands in that location or lower to try and load all files (slow performance, easy to error if files are invalid).When running
steampipe mod init
It would be great to warn if: