loki v1.1.0 Loki.FileManipulation

Helpers for content manipulation injecting, appending, and other.

Summary

Functions

append_to_file(any)
append_to_file(any) :: none
append_to_file(path, content)
append_to_file(Path.t, String.t) :: :ok | {:error, Atom.t}

Helper appends lines to file.

comment_in_file(any)
comment_in_file(any) :: none
comment_in_file(path, content)
comment_in_file(Path.t, String.t) :: :ok | {:error, Atom.t}

Helper comments line in file.

inject_into_file(any)
inject_into_file(any) :: none
inject_into_file(path, injection, order, ancor)
inject_into_file(Path.t, String.t, Atom.t, String.t) ::
  :ok |
  {:error, Atom.t}

Helper injecting lines to file with before and after options.

prepend_to_file(any)
prepend_to_file(any) :: none
prepend_to_file(path, content)
prepend_to_file(Path.t, String.t) :: :ok | {:error, Atom.t}

Helper prepends lines to file.

remove_from_file(any)
remove_from_file(any) :: none
remove_from_file(path, content)
remove_from_file(Path.t, String.t) :: :ok | {:error, Atom.t}

Helper removes lines from file.

replace_in_file(any)
replace_in_file(any) :: none
replace_in_file(path, content, remove)
replace_in_file(String.t, String.t, String.t) ::
  :ok |
  {:error, Atom.t}

Helper replaces lines in file.

uncomment_in_file(any)
uncomment_in_file(any) :: none
uncomment_in_file(path, content)
uncomment_in_file(Path.t, String.t) :: :ok | {:error, Atom.t}

Helper uncomments lines in file.