Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
ca7b46fb
Commit
ca7b46fb
authored
Dec 06, 2018
by
Rin Toshaka
Browse files
Refactor common functions to common.ex
parent
4a2a7ce6
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/mix/tasks/pleroma/instance.ex
View file @
ca7b46fb
...
...
@@ -67,13 +67,19 @@ def run(["gen" | rest]) 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 @@ def run(["gen" | rest]) do
)
end
end
end
lib/mix/tasks/pleroma/relay.ex
View file @
ca7b46fb
...
...
@@ -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 @@ def run(["follow", target]) 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment