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

Fix "phoenix_live_reload/issues/67" #2679

Merged
merged 4 commits into from
Dec 16, 2017
Merged

Fix "phoenix_live_reload/issues/67" #2679

merged 4 commits into from
Dec 16, 2017

Conversation

zhengxiaoyao0716
Copy link
Contributor

Sometimes the built file will be empty after live reload. #67

build_path = Mix.Project.build_path()
symlink = Path.join(Path.dirname(build_path), "__phoenix__")

case File.ln_s(build_path, symlink) do
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this a recursive symlink? I don't think there is anything wrong with it but it would probably be best to avoid it. Maybe we should try to symlink app_path/priv to priv, which is the symlink we would build at the end of the day.

Copy link
Member

Choose a reason for hiding this comment

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

Ignore me, we are using the same link as before. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and I think this is not the best way too. Those codes that create a temp symlink and then remove them maybe just a opportunistic way.
What the can_symlink function actually need to do is just, find that is the task are running
with Administrator and have permission to create symlinks.
But since those codes exist in the old version and the have works well, I became lazy to find other solutions, just move them into the can_symlink function.

defp os_symlink(_),
do: ""

defp can_symlink() do
Copy link
Member

Choose a reason for hiding this comment

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

We can name this function can_symlink? and have it return a boolean.

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.

None yet

2 participants