From f3202a1f62ddb0065b0e73c787ecf3be39ac2df2 Mon Sep 17 00:00:00 2001 From: Connor Prussin Date: Mon, 9 Dec 2019 09:34:50 -0800 Subject: [PATCH] Rename sourcesJson to sourcesFile --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- nix/sources.nix | 4 ++-- src/Niv/Cli.hs | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5341762..818df2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/README.md b/README.md index f49a0bd..8c54e6b 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/nix/sources.nix b/nix/sources.nix index 83a42f4..718ea6f 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -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; }; diff --git a/src/Niv/Cli.hs b/src/Niv/Cli.hs index 953a608..2eaf622 100644 --- a/src/Niv/Cli.hs +++ b/src/Niv/Cli.hs @@ -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) <> "." ]