1
1
mirror of https://github.com/nmattia/niv.git synced 2024-09-18 19:07:19 +03:00

Rename sourcesJson to sourcesFile

This commit is contained in:
Connor Prussin 2019-12-09 09:34:50 -08:00 committed by Nicolas Mattia
parent f518e2e370
commit f3202a1f62
4 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## [0.2.8] 2019-12-00
## Changed
* Fixed message in `niv init` with custom `sources.json`
## [0.2.7] 2019-12-08
## Added
* Support for custom path `sources.json` with `--sources-json`

View File

@ -201,10 +201,10 @@ niv - dependency manager for Nix projects
version: 0.2.7
Usage: niv [-s|--sources-json FILE] COMMAND
Usage: niv [-s|--sources-file FILE] COMMAND
Available options:
-s,--sources-json FILE Use FILE instead of nix/sources.json
-s,--sources-file FILE Use FILE instead of nix/sources.json
-h,--help Show this help text
Available commands:

View File

@ -124,10 +124,10 @@ let
# The "config" used by the fetchers
mkConfig =
{ sourcesJson ? ./sources.json
{ sourcesFile ? ./sources.json
}: rec {
# The sources, i.e. the attribute set of spec name to spec
sources = builtins.fromJSON (builtins.readFile sourcesJson);
sources = builtins.fromJSON (builtins.readFile sourcesFile);
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
pkgs = mkPkgs sources;
};

View File

@ -69,7 +69,7 @@ cli = do
]
parseFindSourcesJson =
AtPath <$> Opts.strOption (
Opts.long "sources-json" <>
Opts.long "sources-file" <>
Opts.short 's' <>
Opts.metavar "FILE" <>
Opts.help "Use FILE instead of nix/sources.json"
@ -154,7 +154,7 @@ cmdInit = do
, "You are using a custom path for sources.json."
]
, " You need to configure the sources.nix to use " <> tbold (T.pack fp) <> ":"
, tbold " import sources.nix { sourcesJson = PATH ; }; "
, tbold " import sources.nix { sourcesFile = PATH ; }; "
, T.unwords
[ " where", tbold "PATH", "is the relative path from sources.nix to"
, tbold (T.pack fp) <> "." ]