Skip to content

Commit

Permalink
Fix line endings on MacOSX
Browse files Browse the repository at this point in the history
  • Loading branch information
g7ed6e committed Nov 2, 2023
1 parent d7aa905 commit ba5cbee
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -273,7 +273,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -371,7 +371,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -463,7 +463,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -555,7 +555,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -647,7 +647,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -739,7 +739,7 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};
Expand Down Expand Up @@ -831,12 +831,25 @@ internal static void RegisterOperationInvokers()
}
#nullable restore
""", Encoding.UTF8, SourceHashAlgorithm.Sha256)),
""".FixLineEndingsOnMacOSX(), Encoding.UTF8, SourceHashAlgorithm.Sha256)),
},
},
};

await test.RunAsync();
}
}

internal static class StringExtensions
{
public static string FixLineEndingsOnMacOSX(this string input)
{
if (Environment.OSVersion.Platform == PlatformID.MacOSX)
{
return input.Replace("\r\n", "\n");
}

return input;
}
}
}

0 comments on commit ba5cbee

Please sign in to comment.