1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

add '://' to built flake uri

This commit is contained in:
Konrad Malik 2023-01-21 15:01:07 +01:00
parent a1ee4d333b
commit fad0282b5f
No known key found for this signature in database

View file

@ -123,13 +123,13 @@ flakeFlags=(--extra-experimental-features 'nix-command flakes')
if [ -n "$flake" ]; then
# Offical regex from https://www.rfc-editor.org/rfc/rfc3986#appendix-B
if [[ "${flake}" =~ ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? ]]; then
scheme=${BASH_REMATCH[2]}
authority=${BASH_REMATCH[4]}
path=${BASH_REMATCH[5]}
scheme=${BASH_REMATCH[2]} # eg. http
authority=${BASH_REMATCH[4]} # eg. www.ics.uci.edu
path=${BASH_REMATCH[5]} # eg. /pub/ietf/uri/
queryWithQuestion=${BASH_REMATCH[6]}
fragment=${BASH_REMATCH[9]}
flake=${scheme}${authority}${path}${queryWithQuestion}
flake=${scheme}://${authority}${path}${queryWithQuestion}
flakeAttr=${fragment}
fi
if [ -z "$flakeAttr" ]; then