Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog for Shellify

## Next Release
- Return exit code zero when some invalid options are passed

## 0.12.0
- Add --allow-local-pinned-registries-to-be-prioritized switch
- Prioiritise registries favouring those not pinned to local
Expand Down
10 changes: 5 additions & 5 deletions src/Constants.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import Data.Text (Text())
import Text.RawString.QQ (r)

helpText :: Text -> Text
helpText progName = "USAGE: " <> progName <> [r| -p [PACKAGES]
|] <> progName <> [r| [--with-flakes] [PACKAGES]
helpText progName = "USAGE: " <> progName <> [r| -p [PACKAGES] [--with-flakes]
|] <> progName <> [r| shell [PACKAGES]

Pass nix-shell arguments to nix-shellify to have it generate a shell.nix in
the current directory. You can then just run nix shell or nix-shell in that
the current directory. You can then just run nix develop or nix-shell in that
directory to have those packages in your environment. To run nix commands
you must first install Nix.

Expand All @@ -21,8 +21,8 @@ Options
Command to run after creating the shell

--with-flake
When using the command in a flake-like style use this switch to have a
flake.nix created in addition to a shell.nix. Highly recommended to ensure
When using the -p option to specify packages, use this switch to have a
flake.nix created in addition to a shell.nix. This is recommended to ensure
the versions of dependencies are kept for reproducibility and so that
shells are cached to load faster.

Expand Down
6 changes: 3 additions & 3 deletions src/Shellify.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ createAFile (name, content) = do extCde <- createFile (unpack name) content
runShellify :: [Text] -> IO ()
runShellify(pName:args) = getRegistryDB
>>= either
((printErrorAndReturnFailure . ("Error calling nix registry: " <>) ) >=> exitWith)
(\registryDB -> either printError
(printErrorAndReturnFailure . ("Error calling nix registry: " <>))
(\registryDB -> either printErrorAndReturnFailure
(mapM_ createAFile)
$ parseOptionsAndCalculateExpectedFiles registryDB pName args)

Expand Down Expand Up @@ -66,6 +66,6 @@ returnCode _ _ = ExitFailure 1
shouldGenerateNewFile :: Maybe Text -> Bool
shouldGenerateNewFile = (== Nothing)

printErrorAndReturnFailure err = printError err >> return (ExitFailure 1)
printErrorAndReturnFailure err = printError err >> exitWith (ExitFailure 1)
printError = hPutStrLn stderr