summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-05-16 07:47:22 +0900
committerGitHub <noreply@github.com>2018-05-16 07:47:22 +0900
commitc54e4672e89a64364124a2db52c745002f7c5d6f (patch)
treeb2869c78c164cdece3bbd36879a6b9abf8fffd9d
parentMerge pull request #1582 from saper/exit-on-config-error (diff)
parentValidate Misskey URL (diff)
downloadsharkey-c54e4672e89a64364124a2db52c745002f7c5d6f.tar.gz
sharkey-c54e4672e89a64364124a2db52c745002f7c5d6f.tar.bz2
sharkey-c54e4672e89a64364124a2db52c745002f7c5d6f.zip
Merge pull request #1583 from saper/validate-url
Validate Misskey URL
-rw-r--r--cli/init.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/init.js b/cli/init.js
index 96160b0b89..5a36509574 100644
--- a/cli/init.js
+++ b/cli/init.js
@@ -18,7 +18,11 @@ const form = [{
}, {
type: 'input',
name: 'url',
- message: 'URL you want to run Misskey:'
+ message: 'URL you want to run Misskey:',
+ validate: function(wannabeurl) {
+ return wannabeurl.match('^http\(s?\)://') ? true :
+ 'URL needs to start with http:// or https://';
+ }
}, {
type: 'input',
name: 'port',