Skip to content

Commit efa71e2

Browse files
committed
Update config file format
This way it is a bit more structured and easier to manage.
1 parent 939948a commit efa71e2

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

config.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
2-
"login": "",
3-
"access_token": "",
4-
"irc-login": "",
5-
"irc-password": ""
2+
"github": {
3+
"login": "",
4+
"access_token": ""
5+
},
6+
"irc": {
7+
"login": "",
8+
"password": ""
9+
},
10+
"squashable": {
11+
"host": "",
12+
"port": 4243,
13+
"secret": ""
14+
}
615
}

lib/Whateverable.pm6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ method upload(%files is copy, :$description = ‘’, Bool :$public = True) {
457457
state $config = from-json slurp CONFIG;
458458
%files = %files.pairs.map: { .key => %( content => .value ) }; # github format
459459

460-
my $gist = Pastebin::Gist.new(token => $config<access_token>);
460+
my $gist = Pastebin::Gist.new(token => $config<github><access_token>);
461461
return $gist.paste: %files, desc => $description, public => $public
462462
}
463463

@@ -467,7 +467,7 @@ method selfrun($nick is copy, @alias?) {
467467
:$nick
468468
:userreal($nick.tc)
469469
:username($nick.substr(0, 3) ~ -able)
470-
:password(?%*ENV<TESTABLE> ?? !! from-json(slurp CONFIG)<irc-login irc-password>.join(:))
470+
:password(?%*ENV<TESTABLE> ?? !! from-json(slurp CONFIG)<irc><login password>.join: :)
471471
:@alias
472472
# IPv4 address of chat.freenode.net is hardcoded so that we can double the limit ↓
473473
:host(%*ENV<TESTABLE> ?? 127.0.0.1 !! (chat.freenode.net, 185.30.166.38).pick)

0 commit comments

Comments
 (0)