Skip to content

Commit 37fa2f0

Browse files
committed
Some formatting of escript
1 parent 588fc25 commit 37fa2f0

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

rebar.config.script

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,19 @@ case file:read_file("priv/swagger/swagger-initializer.js") of
33
{ok, Content} ->
44
%% Get the configuration for the path from the application configuration
55
Path = application:get_env(cowboy_swagger, path, "/api-docs"),
6-
76
%% Ensure Path is a binary (if it's a list, convert to binary)
87
BinPath = case is_binary(Path) of
98
true -> Path;
109
false -> list_to_binary(Path)
1110
end,
12-
1311
%% Determine the path to the JavaScript file
1412
FilePath = "priv/swagger/swagger-initializer.js",
15-
16-
17-
1813
%% Replace the placeholder in the file contents
1914
%% Ensure both the placeholder and replacement are binaries
2015
ModifiedContent = binary:replace(Content, <<"__SWAGGER_PATH__">>, <<"\'", BinPath/binary, "\'">>, [global]),
21-
2216
%% Write the updated file back
2317
ok = file:write_file(FilePath, ModifiedContent),
24-
2518
%% Successfully complete hook execution
26-
2719
io:format("Swagger path updated to: ~s~n", [Path]),
2820
CONFIG;
2921
{error, Reason} ->

0 commit comments

Comments
 (0)