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

Resolve PORTER_HOME when it's symlinked #139

Merged
merged 2 commits into from
Feb 8, 2019

Conversation

carolynvs
Copy link
Member

When someone symlinks /usr/local/bin/porter from ~/.porter/porter, we need to handle that properly
so that we can still find the mixins and other assets in the original directory.

Also cache the resolved PORTER_HOME so we don't have to do that more than once.

When someone symlinks /usr/local/bin/porter from ~/.porter/porter, we need to handle that properly
so that we can still find the mixins and other assests in the original directory.

Cache the resolved PORTER_HOME
@ghost ghost assigned carolynvs Feb 5, 2019
@ghost ghost added the review label Feb 5, 2019
@carolynvs carolynvs mentioned this pull request Feb 5, 2019
Copy link
Contributor

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

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

There are a bunch of other tests failing on Windows, but one introduced by this PR:

--- FAIL: TestConfig_GetHomeDirFromSymlink (0.17s)
    logger.go:11: Resolved porter binary from /usr/local/bin/porter to /root/.porter/porter

    config_test.go:38:
                Error Trace:    config_test.go:38
                Error:          Not equal:
                                expected: "/root/.porter"
                                actual  : "\\root\\.porter"

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -/root/.porter
                                +\root\.porter
                Test:           TestConfig_GetHomeDirFromSymlink

@carolynvs
Copy link
Member Author

@radu-matei Thank you for trying this out on Windows! If you know how to setup an agent on Azure Devops for Windows, we'd appreciate help getting that setup, or a pointer to how you did it for duffle (or some other project).

Fixing now.

@carolynvs
Copy link
Member Author

Fixing now = setting up a windows dev VM so gimme a few hours 😀

@carolynvs
Copy link
Member Author

OK got a different makefile setup to catch these problems. I'll fix this test that I broke and then fix the test and add the new CI setup in another PR so we don't break it again. 😊

@carolynvs carolynvs merged commit 0dbb9d1 into getporter:master Feb 8, 2019
@ghost ghost removed the review label Feb 8, 2019
@carolynvs carolynvs deleted the symlink-foo branch February 8, 2019 21:37
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.

3 participants