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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help wanted: Windows mingw32 shell (git bash) - CRLF #83

Closed
ghost opened this issue Jan 10, 2013 · 12 comments
Closed

Help wanted: Windows mingw32 shell (git bash) - CRLF #83

ghost opened this issue Jan 10, 2013 · 12 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2013

First things first - thanks for great tool 馃憤

I am using Windows now (yeah...) and trying to deploy with Mina.

I found that generated bash script on Windows Git Bash (mingw32 standard shell) has CRLF line endings, but linux use LF, so there are errors like "Unexpected EOF".

I write this generated script to file, convert line endings to LF and use it manually - everything works fine.

Is this a Mina feature or a mingw32 bug or misconfiguration? :)

@rstacruz
Copy link
Member

Hm. Are you trying to deploy to a Windows server, or a running on a Windows workstation?

Thanks for the heads up鈥攗nfortunately we don't have a Windows machine right now to test but I suppose we can work on some hypothetical fixes.

@rezen
Copy link

rezen commented Nov 5, 2013

I'm having the same issue. On Win7x64 trying to deploy to CentOS

 bash: -c line 106: unexpected EOF while looking for a matching `"'

@mcavallo
Copy link

One of my co-workers have this problem as well when deploying to a Ubuntu server. He's on Vista (no comments) with Git Bash (mingw32) and we are using Mina 0.3.0.

@marvinroger
Copy link

I got the same error as @rezen on Windows 8.1 x64 trying to deploy to Ubuntu LTS 12.04.3 x64.

@insub
Copy link

insub commented Jun 7, 2014

@reterius i have same error in windows.
How rite this generated script to file, convert line endings to LF and use it manually ?

@insub
Copy link

insub commented Jul 12, 2014

Now I know why.
Shellwords.escape method for Ruby doesn't support windows environment.
So, in order to fix it, I added a little bit of code to the lib/mina.rb.
It works!

I'm a newbie, so.... but anyway锛宨t works.

# lib/mina.rb
module Mina
  #if windows os
  require 'rbconfig'
  is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) 
  if is_windows
    module Shellwords
      def shellescape(str)
          '"' + str.gsub(/\\(?=\\*\")/, "\\\\\\").gsub(/\"/, "\\\"").gsub(/\\$/, "\\\\\\").gsub("%", "%%") + '"'
      end

      module_function :shellescape
      class << self
        alias escape shellescape
      end
    end
  end
...

@wfschmitt
Copy link

works great !! not newbie .... expert

@rezen
Copy link

rezen commented Dec 3, 2014

Did this tweak make it into the codebase?

@kim3er
Copy link

kim3er commented Feb 4, 2015

Would it help progress this issue, if I put @insub's fix into a pull request?

insub added a commit to insub/mina that referenced this issue Oct 12, 2015
@dynasource
Copy link

@coredevelopers: any reason why this isnt picked up? Solution by insub works. Why not do minor patches to support the windows community?

@dima-stefantsov
Copy link

It works indeed. Thanks!

@d4be4st
Copy link
Member

d4be4st commented Jul 30, 2016

Can someome test github master if this works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants