aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo?o Duarte <jvsDuarte08@gmail.com>2019-07-16 10:08:12 -0700
committerJo?o Duarte <jvsDuarte08@gmail.com>2019-07-16 10:08:12 -0700
commitc8848c38c99500ed686924689b96ae7d9e477922 (patch)
treee85b66fc48c0fe824ebf321de8ffef7da5fd76b2
parent9235343665d689cdd0c47ab5bc775864c3b006fb (diff)
downloadprosody-c8848c38c99500ed686924689b96ae7d9e477922.tar.gz
prosody-c8848c38c99500ed686924689b96ae7d9e477922.zip
prosodyctl: Added the 'write_rockspec' function
-rwxr-xr-xprosodyctl16
1 files changed, 16 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index 0bde4478..baea969a 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -113,6 +113,22 @@ function commands.get_modules(arg)
end
end
+-- Function to write rockspecs from a module at working_directory/downloaded_modules
+-- Receives the module's name as an argument
+-- The rockspec is saved inside its module's folder
+function commands.write_rockspec(arg)
+ if arg[1] == "--help" then
+ show_usage([[write_rockspec]], [[Picks up a module and writes an initial rockspec]]);
+ return 1
+ end
+ print("Writing rockspec for "..arg[1])
+ os.execute("luarocks write_rockspec "..arg[1].." ./downloaded_modules/"..arg[1])
+ print("Rockspec created! Moving it into the ./downloaded_modules/"..arg[1].." folder")
+ os.execute("mv "..arg[1].."-scm-1.rockspec ./downloaded_modules/"..arg[1])
+ print("Done!")
+ return 0
+end
+
function commands.list(arg)
if not arg[1] or arg[1] == "--help" then
show_usage([[list]], [[Shows installed rocks]]);