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

saving windows to linux? #25

Closed
mark-hahn opened this issue Aug 6, 2014 · 5 comments
Closed

saving windows to linux? #25

mark-hahn opened this issue Aug 6, 2014 · 5 comments

Comments

@mark-hahn
Copy link

When I save a file I get a message like this ...

Uploading: c:\ri\src\pages\version\versions.txt to C:\ri\src\pages\version\versions.txt
Uploaded: c:\ri\src\pages\version\versions.txt to C:\ri\src\pages\version\versions.txt

Since the destination is linux the right path makes no sense. After this the file on linux is not changed. I looked for copies of *versions.txt and I could only find the old one.

Here is my json file ...

{
  "transport": "scp",
  "hostname": "dev.reevuit.com",
  "port": 22,
  "username": "ubuntu",
  "keyfile": "C:/keys/mch-tbg.pem",
  "target": "/ri",
  "ignore": [
    ".git/**"
  ]
}

I'm on windows 8.0 and atom 0.120.0.

@mark-hahn
Copy link
Author

I changed my version so that the targetFilePath is changed to unix format. This works for me now but this may not work for other types of destinations.

targetFilePath = path.resolve(@settings.target,
                      path.relative(atom.project.getPath(), localFilePath))

targetFilePath = targetFilePath.replace /\\/g, '/'
if targetFilePath[0..1].toLowerCase() is 'c:'
    targetFilePath = targetFilePath[2..]
console.log {localFilePath, targetFilePath, projPath: atom.project.getPath()}

@yongkangchen
Copy link
Owner

console.log {localFilePath, targetFilePath, projPath: atom.project.getPath()}

could you please provide output for me to check the issue?

@mark-hahn
Copy link
Author

My fix isn't very good. It works only with C drive and it may not work with windows or mac destinations. Anyway, here is the log with the original code ...

{localFilePath: "c:\ri\src\pages\version\versions.txt", targetFilePath: "C:\ri\src\pages\version\versions.txt", projPath: "c:\ri"}
Uploading: c:\ri\src\pages\version\versions.txt to C:\ri\src\pages\version\versions.txt 
Uploaded: c:\ri\src\pages\version\versions.txt to C:\ri\src\pages\version\versions.txt 

And this is with my change ...

{localFilePath: "c:\ri\src\pages\version\versions.txt", targetFilePath: "/ri/src/pages/version/versions.txt", projPath: "c:\ri"} 
Uploading: c:\ri\src\pages\version\versions.txt to /ri/src/pages/version/versions.txt
Uploaded: c:\ri\src\pages\version\versions.txt to /ri/src/pages/version/versions.txt 

@mark-hahn
Copy link
Author

BTW, now that this is working right, I love it. A good package just right for what I need.

@yongkangchen
Copy link
Owner

Thanks for the issue.

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

No branches or pull requests

2 participants