-
Notifications
You must be signed in to change notification settings - Fork 18
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
Switched home fetch to local function with windows compatability #568
Conversation
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.
awesome work, looks great! 😁 a few minor nitpicks if you want to fix them!
cmd/inpututil/input.go
Outdated
sshDir := filepath.Join(homeEnvVar, ".ssh") | ||
defaultSSHLoc := filepath.Join(sshDir, "id_rsa") | ||
|
||
var response string | ||
fmt.Println("Enter location of PEM file (leave blank to use '" + defaultSSHLoc + "'):") | ||
_, err := fmt.Fscanln(in, &response) | ||
_, err = fmt.Fscanln(in, &response) | ||
if err != nil { |
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.
while you're at it, could make this a one-liner? 😋
if _, err = fmt.Fscanln(in, &response); err != nil {
...
}
Co-Authored-By: yaoharry <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #568 +/- ##
=========================================
- Coverage 56.19% 56.08% -0.1%
=========================================
Files 62 62
Lines 3015 3019 +4
=========================================
- Hits 1694 1693 -1
- Misses 1115 1119 +4
- Partials 206 207 +1
Continue to review full report at Codecov.
|
daemon/inertiad/build/util.go
Outdated
) | ||
|
||
// getTrueDirectory converts given filepath to host-based filepath if applicable | ||
// - Docker commands are sent to the mounted Docker socket and hence are | ||
// executed on the host, using the host's filepaths, which means Docker client | ||
// commands must use this function when dealing with paths | ||
func getTrueDirectory(path string) string { | ||
return strings.Replace(path, "/app/host", os.Getenv("HOME"), 1) | ||
homeDir, _ := local.GetHomePath() | ||
return strings.Replace(path, "/app/host", homeDir, 1) |
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 should remove this for now - daemonside windows compatibility is a much harder and nuanced issue, and a separate ticket is open for that (#407). Also trying to avoid introducing dependencies on inertia/local
from the daemon for now, to avoid dependency creep 👌
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 for letting me know. I reverted the changes for util.go.
great work @yaoharry ! |
🎟️ Ticket(s): Closes #400 , closes #519 , follow-up to #552
👷 Changes
Updated home path checking with local function with windows compatibility check
🔦 Testing Instructions
$HOME
environment variable is the same as returned value fromlocal.GetHomePath()