Packages

Git hooks made easy. Husky can prevent bad git commit, git push and more 🐶 ❤️ woof! - Elixir equivalent of the husky npm package

Current section

Files

Jump to
husky lib delete.ex
Raw

lib/delete.ex

defmodule Mix.Tasks.Husky.Delete do
use Mix.Task
require Logger
def run(args) do
Mix.shell().info("... running husky delete")
Logger.debug("args=#{inspect(args)}")
Application.get_env(:husky, :hook_list)
|> delete_project_hook_scripts(Application.get_env(:husky, :git_hooks_location))
end
def delete_project_hook_scripts(hooks, location) do
hooks
|> Enum.map(fn file -> Path.join(location, file) end)
|> Enum.map(&File.rm/1)
File.rmdir(location)
end
end