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