fetchbower: clean common uri characters from version string
Some bower.json files have URL dependencies missing a version. Fixes rvl/bower2nix#18
This commit is contained in:
parent
0a5ecde808
commit
9b0d50e3d0
|
@ -4,13 +4,13 @@ let
|
||||||
let
|
let
|
||||||
components = lib.splitString "#" version;
|
components = lib.splitString "#" version;
|
||||||
hash = lib.last components;
|
hash = lib.last components;
|
||||||
ver = if builtins.length components == 1 then version else hash;
|
ver = if builtins.length components == 1 then (cleanName version) else hash;
|
||||||
in ver;
|
in ver;
|
||||||
|
|
||||||
bowerName = name: lib.replaceStrings ["/"] ["-"] name;
|
cleanName = name: lib.replaceStrings ["/" ":"] ["-" "-"] name;
|
||||||
|
|
||||||
fetchbower = name: version: target: outputHash: stdenv.mkDerivation {
|
fetchbower = name: version: target: outputHash: stdenv.mkDerivation {
|
||||||
name = "${bowerName name}-${bowerVersion version}";
|
name = "${cleanName name}-${bowerVersion version}";
|
||||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"
|
fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user