Browse Source

Naked domain

tags/v0.1.2
aeris 1 year ago
parent
commit
99ac0f1be4
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      bin/mastodon-register

+ 3
- 2
bin/mastodon-register View File

@@ -3,11 +3,12 @@ require 'cross-post'
3 3
 require 'mastodon'
4 4
 require 'oauth2'
5 5
 require 'launchy'
6
+require 'uri'
6 7
 
7 8
 config = CrossPost::Config.new
8 9
 print 'Mastodon URL ? '
9
-url                    = gets.strip
10
-url                    = "https://#{url}" unless url.start_with? 'https://'
10
+url                    = gets.chomp
11
+url = "https://#{url}" if URI.parse(url).class == URI::Generic
11 12
 config['mastodon.url'] = url
12 13
 
13 14
 client_id, client_secret = unless config['mastodon.consumer']

Loading…
Cancel
Save