View Source file_utils (migraterl v0.1.1)

Internal module, handy functions for file and directory manipulation.

Summary

Types

directory/0

-type directory() :: file:name_all().

filename/0

-type filename() :: file:name_all().

sql/0

-type sql() :: string().

Functions

format_bin_content(Bin)

-spec format_bin_content(Bin) -> Result
                            when
                                Bin :: binary(),
                                Ok :: {ok, sql()},
                                Reason :: string(),
                                Error :: {error, Reason},
                                Result :: Ok | Error.

read_directory(Dir)

-spec read_directory(Dir :: directory()) -> Result
                        when
                            Reason :: string(),
                            Error :: {error, Reason},
                            Ok :: {ok, [filename()]},
                            Result :: Ok | Error.

read_system_migrations()

-spec read_system_migrations() -> Result
                                when
                                    Reason :: string(),
                                    Error :: {error, Reason},
                                    Ok :: {ok, directory()},
                                    Result :: Ok | Error.