diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-05-16 07:47:22 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-16 07:47:22 +0900 |
| commit | c54e4672e89a64364124a2db52c745002f7c5d6f (patch) | |
| tree | b2869c78c164cdece3bbd36879a6b9abf8fffd9d | |
| parent | Merge pull request #1582 from saper/exit-on-config-error (diff) | |
| parent | Validate Misskey URL (diff) | |
| download | sharkey-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.js | 6 |
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', |