mirror of
https://github.com/hercules-ci/arion.git
synced 2024-11-29 22:51:11 +03:00
Implement uid parameter
This commit is contained in:
parent
77c492fa86
commit
02c0f80b02
@ -38,6 +38,7 @@ common deps
|
|||||||
, temporary
|
, temporary
|
||||||
, text
|
, text
|
||||||
, protolude
|
, protolude
|
||||||
|
, unix
|
||||||
|
|
||||||
flag ghci
|
flag ghci
|
||||||
default: False
|
default: False
|
||||||
|
@ -22,9 +22,10 @@ import qualified Data.Text.Lazy.Builder as TB
|
|||||||
import qualified Data.List.NonEmpty as NE
|
import qualified Data.List.NonEmpty as NE
|
||||||
import Data.List.NonEmpty (NonEmpty(..))
|
import Data.List.NonEmpty (NonEmpty(..))
|
||||||
|
|
||||||
|
|
||||||
import Control.Arrow ((>>>))
|
import Control.Arrow ((>>>))
|
||||||
|
|
||||||
|
import System.Posix.User (getRealUserID)
|
||||||
|
|
||||||
data CommonOptions =
|
data CommonOptions =
|
||||||
CommonOptions
|
CommonOptions
|
||||||
{ files :: NonEmpty FilePath
|
{ files :: NonEmpty FilePath
|
||||||
@ -159,14 +160,16 @@ runEvalAndDC cmd dopts opts = do
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultEvaluationArgs :: CommonOptions -> IO EvaluationArgs
|
defaultEvaluationArgs :: CommonOptions -> IO EvaluationArgs
|
||||||
defaultEvaluationArgs co = pure EvaluationArgs
|
defaultEvaluationArgs co = do
|
||||||
{ evalUid = 0 -- TODO
|
uid <- getRealUserID
|
||||||
, evalModules = files co
|
pure EvaluationArgs
|
||||||
, evalPkgs = pkgs co
|
{ evalUid = fromIntegral uid
|
||||||
, evalWorkDir = Nothing
|
, evalModules = files co
|
||||||
, evalMode = ReadWrite
|
, evalPkgs = pkgs co
|
||||||
, evalUserArgs = nixArgs co
|
, evalWorkDir = Nothing
|
||||||
}
|
, evalMode = ReadWrite
|
||||||
|
, evalUserArgs = nixArgs co
|
||||||
|
}
|
||||||
|
|
||||||
runCat :: CommonOptions -> IO ()
|
runCat :: CommonOptions -> IO ()
|
||||||
runCat co = do
|
runCat co = do
|
||||||
|
Loading…
Reference in New Issue
Block a user