File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,9 @@ defmodule Mix.Tasks.E2e.UpdateExamplesWorkflow do
79
79
end
80
80
81
81
defp generate_job ( % Entry { } = entry ) do
82
- pre_indented_script_lines = entry . script |> String . trim_trailing |> dedent_string |> indent_string ( 10 )
82
+ pre_indented_script_lines =
83
+ entry . script |> String . trim_trailing ( ) |> dedent_string |> indent_string ( 10 )
84
+
83
85
# ↑
84
86
# No trailing empty lines because we tightly control how script-lines are placed within the template
85
87
# ↑↑
@@ -119,12 +121,15 @@ defmodule Mix.Tasks.E2e.UpdateExamplesWorkflow do
119
121
@ spec dedent_string ( String . t ( ) ) :: String . t ( )
120
122
defp dedent_string ( str ) do
121
123
lines = String . split ( str , "\n " )
124
+
122
125
smallest_indent =
123
126
lines
124
- |> Enum . reject ( & String . trim ( & 1 ) == "" ) # Ignore empty or whitespace-only lines
127
+ # Ignore empty or whitespace-only lines
128
+ |> Enum . reject ( & ( String . trim ( & 1 ) == "" ) )
125
129
|> Enum . map ( & String . length ( Regex . replace ( ~r/ ^(\s *).*$/ , & 1 , "\\ 1" ) ) )
126
130
|> Enum . min ( )
127
- |> Kernel . || ( 0 ) # Default to 0 if the list is empty
131
+ # Default to 0 if the list is empty
132
+ |> Kernel . || ( 0 )
128
133
129
134
lines
130
135
|> Enum . map ( fn line ->
You can’t perform that action at this time.
0 commit comments