Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Strip Windows Line Endings #280

Merged
merged 1 commit into from

2 participants

@pmorton

In know, foreman does not support windows. However we are using vagrant to host (windows) VM machines and mounting a shared source directory on the guest (linux). For various reason, we prefer that git use windows line endings instead of unix line endings. When you checkout a repo from a windows host and mount it on a linux machine, foreman fails to properly parse arguments in that \r is included as a argument event though it should be ignored. This causes foreman start to fail.

@ddollar ddollar merged commit 21dd610 into ddollar:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 18, 2012
  1. @pmorton

    Strip Windows Line Endings

    pmorton authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/foreman/env.rb
  2. +1 −1  lib/foreman/procfile.rb
View
2  lib/foreman/env.rb
@@ -5,7 +5,7 @@ class Foreman::Env
attr_reader :entries
def initialize(filename)
- @entries = File.read(filename).split("\n").inject({}) do |ax, line|
+ @entries = File.read(filename).gsub("\r\n","\n").split("\n").inject({}) do |ax, line|
if line =~ /\A([A-Za-z_0-9]+)=(.*)\z/
key = $1
case val = $2
View
2  lib/foreman/procfile.rb
@@ -82,7 +82,7 @@ def to_s
private
def parse(filename)
- File.read(filename).split("\n").map do |line|
+ File.read(filename).gsub("\r\n","\n").split("\n").map do |line|
if line =~ /^([A-Za-z0-9_]+):\s*(.+)$/
[$1, $2]
end
Something went wrong with that request. Please try again.