File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ defmodule Mix.Tasks.Archive.Uninstall do
2323 Mix.Task . run "archive"
2424 end
2525 else
26- Mix . raise "No archive was given to uninstall"
26+ Mix . raise "No archive was given to archive. uninstall"
2727 end
2828 end
2929end
Original file line number Diff line number Diff line change 1+ defmodule Mix.Tasks.Escript.Uninstall do
2+ use Mix.Task
3+
4+ @ shortdoc "Uninstall escripts"
5+
6+ @ moduledoc """
7+ Uninstall local escripts:
8+
9+ mix escript.uninstall escript_name
10+
11+ """
12+ @ spec run ( OptionParser . argv ) :: :ok
13+ def run ( argv ) do
14+ { _ , argv , _ } = OptionParser . parse ( argv )
15+
16+ if name = List . first ( argv ) do
17+ path = Path . join ( Mix.Local . escripts_path , name )
18+ if File . regular? ( path ) do
19+ File . rm! ( path )
20+ else
21+ Mix . shell . error "Could not find a local escript named #{ inspect name } . " <>
22+ "Existing escripts are:"
23+ Mix.Task . run "escript"
24+ end
25+ else
26+ Mix . raise "No escript was given to escript.uninstall"
27+ end
28+ end
29+ end
You can’t perform that action at this time.
0 commit comments