Merge pull request 'Update elixir versions' (#512) from norm/akkoma:update-elixir...
[akkoma] / lib / mix / tasks / pleroma / instance.ex
index d98cb8e37cee1391212260c277df0f1d42364a65..52fd184b5d9e7defb244ad92db0d28e1cd91a2b2 100644 (file)
@@ -9,7 +9,7 @@ defmodule Mix.Tasks.Pleroma.Instance do
   alias Pleroma.Config
 
   @shortdoc "Manages Pleroma instance"
-  @moduledoc File.read!("docs/administration/CLI_tasks/instance.md")
+  @moduledoc File.read!("docs/docs/administration/CLI_tasks/instance.md")
 
   def run(["gen" | rest]) do
     {options, [], []} =
@@ -59,7 +59,7 @@ defmodule Mix.Tasks.Pleroma.Instance do
           get_option(
             options,
             :domain,
-            "What domain will your instance use? (e.g pleroma.soykaf.com)"
+            "What domain will your instance use? (e.g akkoma.example.com)"
           ),
           ":"
         ) ++ [443]
@@ -100,14 +100,14 @@ defmodule Mix.Tasks.Pleroma.Instance do
 
       dbhost = get_option(options, :dbhost, "What is the hostname of your database?", "localhost")
 
-      dbname = get_option(options, :dbname, "What is the name of your database?", "pleroma")
+      dbname = get_option(options, :dbname, "What is the name of your database?", "akkoma")
 
       dbuser =
         get_option(
           options,
           :dbuser,
           "What is the user used to connect to your database?",
-          "pleroma"
+          "akkoma"
         )
 
       dbpass =
@@ -247,9 +247,13 @@ defmodule Mix.Tasks.Pleroma.Instance do
       config_dir = Path.dirname(config_path)
       psql_dir = Path.dirname(psql_path)
 
-      [config_dir, psql_dir, static_dir, uploads_dir]
-      |> Enum.reject(&File.exists?/1)
-      |> Enum.map(&File.mkdir_p!/1)
+      to_create =
+        [config_dir, psql_dir, static_dir, uploads_dir]
+        |> Enum.reject(&File.exists?/1)
+
+      for dir <- to_create do
+        File.mkdir_p!(dir)
+      end
 
       shell_info("Writing config to #{config_path}.")
 
@@ -319,6 +323,4 @@ defmodule Mix.Tasks.Pleroma.Instance do
 
     enabled_filters
   end
-
-  defp upload_filters(_), do: []
 end