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

Replicate local absolute path on remote machine #236

Merged
merged 3 commits into from
Nov 15, 2018

Conversation

artem-zinnatullin
Copy link
Contributor

Closes #214.

As discussed in #214, we now replicate absolute path from local machine in ~/mainframer/… on remote machine.

This allows user to have multiple projects with same leaf node in the path without clashing, ie:

  • /home/artem_zin/myproject/home/remote_user/mainframer/home/artem_zin/myproject
  • /home/artem_zin/projects/myproject/home/remote_user/mainframer/home/artem_zin/projects/myproject

We can also add local machine hostname, but I don't think it's a good idea.


Integration tests were updated to expect files in new path. Also tested myself.

src/sync.rs Outdated
fn project_dir_on_remote_machine(local_project_dir_name: &str) -> String {
format!("~/mainframer/{}", local_project_dir_name)
pub fn project_dir_on_remote_machine(local_dir_absolute_path: &Path) -> String {
format!("~/mainframer/{}", local_dir_absolute_path.to_string_lossy())
Copy link
Contributor

Choose a reason for hiding this comment

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

Could it be here "~/mainframer//home/user/project" as a result?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Snap, good catch 👍

Most of the time it's harmless to do so (you can check in your terminal), but I definitely did not intend that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

foxed, thanks again 😽

@artem-zinnatullin artem-zinnatullin merged commit 1097180 into 3.x Nov 15, 2018
@artem-zinnatullin artem-zinnatullin deleted the az/replicate-local-abs-path branch November 15, 2018 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants