loki v1.0.1 Loki.FileManipulation

Helpers for content manipulation injecting, appending, and other.

Summary

Functions

Helper appends lines to file

Helper comments line in file

Helper injecting lines to file with before and after options

Helper prepends lines to file

Helper removes lines from file

Helper replaces lines in file

Helper uncomments lines in file

Functions

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

Helper appends lines to file.

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

Helper comments line in file.

inject_into_file(path, injection, state)
inject_into_file(String.t, String.t, any) ::
  :ok |
  {:error, Atom.t}

Helper injecting lines to file with before and after options.

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

Helper prepends lines to file.

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

Helper removes lines from file.

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(path, content)
uncomment_in_file(Path.t, String.t) :: :ok | {:error, Atom.t}

Helper uncomments lines in file.