remove recently added and unncessary cwd parameter

I later made Utility.Su change back to the cwd, so this parameter is not
needed.
This commit is contained in:
Joey Hess 2019-10-21 13:46:11 -04:00
parent b94f2c18e1
commit 668b878995
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -49,16 +49,12 @@ start _os = do
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
curruserid <- liftIO getEffectiveUserID curruserid <- liftIO getEffectiveUserID
if curruserid == 0 if curruserid == 0
then case os of then case readish =<< headMaybe os of
(uid:[]) -> go uid Nothing -> giveup "Need user-id parameter."
(uid:repodir:_) -> do Just userid -> go userid
Annex.changeDirectory repodir
go uid
_ -> giveup "Need user-id parameter."
else starting "enable-tor" (ActionItemOther Nothing) $ do else starting "enable-tor" (ActionItemOther Nothing) $ do
gitannex <- liftIO readProgramFile gitannex <- liftIO readProgramFile
cwd <- liftIO getCurrentDirectory let ps = [Param (cmdname cmd), Param (show curruserid)]
let ps = [Param (cmdname cmd), Param (show curruserid), Param cwd]
sucommand <- liftIO $ mkSuCommand gitannex ps sucommand <- liftIO $ mkSuCommand gitannex ps
maybe noop showLongNote maybe noop showLongNote
(describePasswordPrompt' sucommand) (describePasswordPrompt' sucommand)
@ -68,12 +64,10 @@ start _os = do
[ "Failed to run as root:" , gitannex ] ++ toCommand ps [ "Failed to run as root:" , gitannex ] ++ toCommand ps
) )
#else #else
go "0" go 0
#endif #endif
where where
go suserid = case readish suserid of go userid = do
Nothing -> giveup "Unable to parse user-id parameter."
Just userid -> do
uuid <- getUUID uuid <- getUUID
when (uuid == NoUUID) $ when (uuid == NoUUID) $
giveup "This can only be run in a git-annex repository." giveup "This can only be run in a git-annex repository."