mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
parent
f1adf4c998
commit
a8925a510c
1 changed files with 2 additions and 0 deletions
|
@ -61,6 +61,8 @@ sub writeChannels {
|
||||||
# Adds a channel.
|
# Adds a channel.
|
||||||
sub addChannel {
|
sub addChannel {
|
||||||
my ($url, $name) = @_;
|
my ($url, $name) = @_;
|
||||||
|
die "invalid channel URL ‘$url’" unless $url =~ /^(file|http|https):\/\//;
|
||||||
|
die "invalid channel identifier ‘$name’" unless $name =~ /^[a-zA-Z0-9_][a-zA-Z0-9_\-\.]*$/;
|
||||||
readChannels;
|
readChannels;
|
||||||
$channels{$name} = $url;
|
$channels{$name} = $url;
|
||||||
writeChannels;
|
writeChannels;
|
||||||
|
|
Loading…
Reference in a new issue