aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRin Toshaka <rinpatch@sdf.org>2018-12-06 18:01:28 +0100
committerRin Toshaka <rinpatch@sdf.org>2018-12-06 18:01:28 +0100
commitca7b46fb3ba576fb7e67eba02654e6df9299392a (patch)
tree5d7d22cc7c848a7db168283cba61e104bfb279d2
parent4a2a7ce636ac4616ec71665b4af4ee0ab884ac15 (diff)
downloadpleroma-ca7b46fb3ba576fb7e67eba02654e6df9299392a.tar.gz
Refactor common functions to common.ex
-rw-r--r--lib/mix/tasks/pleroma/instance.ex15
-rw-r--r--lib/mix/tasks/pleroma/relay.ex5
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex
index 88fc3ba75..e0ebb3f5e 100644
--- a/lib/mix/tasks/pleroma/instance.ex
+++ b/lib/mix/tasks/pleroma/instance.ex
@@ -67,13 +67,19 @@ defmodule Mix.Tasks.Pleroma.Instance do
)
name =
- Common.get_option(options, :name, "What is the name of your instance? (e.g. Pleroma/Soykaf)")
+ Common.get_option(
+ options,
+ :name,
+ "What is the name of your instance? (e.g. Pleroma/Soykaf)"
+ )
email = Common.get_option(options, :admin_email, "What is your admin email address?")
- dbhost = Common.get_option(options, :dbhost, "What is the hostname of your database?", "localhost")
+ dbhost =
+ Common.get_option(options, :dbhost, "What is the hostname of your database?", "localhost")
- dbname = Common.get_option(options, :dbname, "What is the name of your database?", "pleroma_dev")
+ dbname =
+ Common.get_option(options, :dbname, "What is the name of your database?", "pleroma_dev")
dbuser =
Common.get_option(
@@ -145,7 +151,4 @@ defmodule Mix.Tasks.Pleroma.Instance do
)
end
end
-
-
-
end
diff --git a/lib/mix/tasks/pleroma/relay.ex b/lib/mix/tasks/pleroma/relay.ex
index 828c7cd3d..4aea52732 100644
--- a/lib/mix/tasks/pleroma/relay.ex
+++ b/lib/mix/tasks/pleroma/relay.ex
@@ -20,7 +20,8 @@ defmodule Mix.Tasks.Pleroma.Relay do
Example: ``mix pleroma.relay unfollow https://example.org/relay``
"""
def run(["follow", target]) do
- Common.start_pleroma
+ Common.start_pleroma()
+
with {:ok, activity} <- Relay.follow(target) do
# put this task to sleep to allow the genserver to push out the messages
:timer.sleep(500)
@@ -30,7 +31,7 @@ defmodule Mix.Tasks.Pleroma.Relay do
end
def run(["unfollow", target]) do
- Common.start_pleroma
+ Common.start_pleroma()
with {:ok, activity} <- Relay.follow(target) do
# put this task to sleep to allow the genserver to push out the messages