google / skicka

Command-line utility for working with Google Drive. Join the mailing list at https://groups.google.com/forum/#!forum/skicka-users.
Apache License 2.0
1.3k stars 118 forks source link

Made changes to allow compatablity with windows #56

Closed unseenline closed 9 years ago

unseenline commented 9 years ago

Did testing to check compatibility and functionally was not broken for Linux. Did testing on a Ubuntu 14.04 LTS VM. Only new to Go so there is probably a better way to handle the compatibly Most of the issues I saw were related to the path separator differences.

gusennan commented 9 years ago

@unseenline the constant os.PathSeparator is probably what you're looking for. No need to create a function for it.

mmp commented 9 years ago

Ah, nice. I had some in-progress changes that also addressed part of this already (using filepath.Join to construct paths, rather than manually concatenating strings and "/" characters), so I'll switch over to os.PathSeparator there. Will push all this in a few hours after some more testing; if you can check on Windows after that lands @unseenline, that'd be fantastic.

mmp commented 9 years ago

Changes pushed!

unseenline commented 9 years ago

Looked like it works except for one of the recent changes made prevents the application from building. github.com/google/skicka .\download.go:339: undefined: syscall.Umask .\download.go:340: undefined: syscall.Umask

Code on these lines 339: oldmask := syscall.Umask(0) 340: defer syscall.Umask(oldmask)

Looks like Umask is not available in the windows version of go. Is there an alternative that doesn't break the compatibility?

mmp commented 9 years ago

Ah, sorry about that. I've rewritten it to not use Umask (but still have the same effect on Unix) and have pushed the change. Let me know how this one goes!

unseenline commented 9 years ago

Thanks, looks like that solved the issue.