mirror of
https://github.com/nix-community/nixpkgs-update.git
synced 2024-11-29 16:52:31 +03:00
skip updateScript rewriter if there is no updateScript
This commit is contained in:
parent
f07e4069cc
commit
a2a9bcafc1
@ -243,16 +243,20 @@ golangModuleVersion log args@Args {..} = do
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Calls passthru.updateScript
|
-- Calls passthru.updateScript
|
||||||
updateScript :: MonadIO m => (Text -> m ()) -> Args -> ExceptT Text m (Maybe Text)
|
updateScript :: MonadIO m => (Text -> m ()) -> Args -> ExceptT Text m (Maybe Text)
|
||||||
updateScript log args = do
|
updateScript log Args {..} = do
|
||||||
(exitCode, msg) <- Nix.runUpdateScript (attrPath args)
|
if hasUpdateScript
|
||||||
case exitCode of
|
then do
|
||||||
ExitSuccess -> do
|
(exitCode, msg) <- Nix.runUpdateScript attrPath
|
||||||
lift $ log "Success"
|
case exitCode of
|
||||||
lift $ log msg
|
ExitSuccess -> do
|
||||||
return $ Just "Ran passthru.UpdateScript"
|
lift $ log "Success"
|
||||||
ExitFailure num -> do
|
lift $ log msg
|
||||||
throwE $ "[updateScript] Failed with exit code " <> tshow num <> "\n" <> msg
|
return $ Just "Ran passthru.UpdateScript"
|
||||||
|
ExitFailure num -> do
|
||||||
|
throwE $ "[updateScript] Failed with exit code " <> tshow num <> "\n" <> msg
|
||||||
|
else do
|
||||||
|
lift $ log "skipping because derivation has no updateScript"
|
||||||
|
return Nothing
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Common helper functions and utilities
|
-- Common helper functions and utilities
|
||||||
-- Helper to update version and src attributes, re-computing the sha256.
|
-- Helper to update version and src attributes, re-computing the sha256.
|
||||||
|
Loading…
Reference in New Issue
Block a user