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:
parent
b94f2c18e1
commit
668b878995
1 changed files with 13 additions and 19 deletions
|
@ -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."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue