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.
|
||||
sub addChannel {
|
||||
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;
|
||||
$channels{$name} = $url;
|
||||
writeChannels;
|
||||
|
|
Loading…
Reference in a new issue