Skip to content
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

Use Windows User Directory for bin path #327

Merged
merged 8 commits into from
Mar 31, 2024

Conversation

MatrixCrawler
Copy link
Collaborator

@MatrixCrawler MatrixCrawler commented Mar 14, 2024

Fixes #199

  • use windows user directory for bin path as default in windows
  • copy terraform.exe to bin path as symlink does not workl correctly
  • update x/text package due to vulnerability
  • fix various typos

@yermulnik
Copy link
Collaborator

Repo is not in active development at the moment 😢 #324

@MatrixCrawler
Copy link
Collaborator Author

Will have to rebase first

@MatrixCrawler MatrixCrawler force-pushed the windows-home-dir branch 2 times, most recently from 2627b96 to 7390720 Compare March 28, 2024 12:09
@MatrixCrawler
Copy link
Collaborator Author

Done with the rebasing

lib/defaults.go Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/download_test.go Outdated Show resolved Hide resolved
@yermulnik
Copy link
Collaborator

Done with the rebasing

Still merge conflict is there

MatrixCrawler and others added 4 commits March 29, 2024 19:54
…n main and lib.

- added detection of home directory in case we are using windows.
- updated tests accordingly.
Copy link
Owner

@warrensbox warrensbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linux and MacOs version works.

@warrensbox
Copy link
Owner

@yermulnik can you review again?

lib/symlink.go Outdated
log.Fatalf(`
w, err := os.Create(dir + ".exe")
if err != nil {
log.Fatalf(`Could not create target binary: %s.`, dir+".exe")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same as #327 (comment) — are backticks intentional?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use double quotes for consistency?

lib/symlink.go Outdated Show resolved Hide resolved
lib/symlink.go Outdated Show resolved Hide resolved
} else {
err := os.Symlink(cwd, dir)
if err != nil {
log.Fatalf(`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can backticks be converted to double quotes for consistency (given there are double quotes inside the message — can they be escaped or single quotes used)?

lib/symlink_test.go Outdated Show resolved Hide resolved
lib/symlink_test.go Outdated Show resolved Hide resolved
@yermulnik
Copy link
Collaborator

@yermulnik can you review again?

It looks good to me apart 1) defaults.go vs utils.go and 2) backticks vs double quotes nitpicks.

ps: Thanks for pinging me as I was waiting for @MatrixCrawler to re-request review once he's done with updates. Apologies for delay.

@yermulnik
Copy link
Collaborator

@yermulnik can you review again?

It looks good to me apart 1) defaults.go vs utils.go and 2) backticks vs double quotes nitpicks.

@MatrixCrawler @warrensbox Please let me know whether this is meant to be worked on in a new PR and I'll be happy to add my approval to get this merged and released.

MatrixCrawler and others added 3 commits March 31, 2024 20:18
Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
@MatrixCrawler
Copy link
Collaborator Author

@yermulnik can you review again?

It looks good to me apart 1) defaults.go vs utils.go and 2) backticks vs double quotes nitpicks.

@MatrixCrawler @warrensbox Please let me know whether this is meant to be worked on in a new PR and I'll be happy to add my approval to get this merged and released.

I would see to this in a later PR as i introduce the defaults and the utils in two new PR's. There should be a consolidation, refactoring at a later point.
Just my 2 cents

@yermulnik
Copy link
Collaborator

I would see to this in a later PR as i introduce the defaults and the utils in two new PR's. There should be a consolidation, refactoring at a later point.

I don't see why the consolidation cannot be done in this PR given both are authored by you and this could reduce a number of extra PRs just to merge two files with helper functions 🤷🏻
Either way I approved this PR, @MatrixCrawler please go ahead with merging it whenever you're up for it 🤝

@warrensbox warrensbox merged commit e5ca144 into warrensbox:master Mar 31, 2024
@MatrixCrawler MatrixCrawler deleted the windows-home-dir branch April 2, 2024 06:42
@yermulnik yermulnik mentioned this pull request Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

This doesn't work on Windows despite there being a binary
3 participants