on master help sign in
Add isolateGitProc
commit50e345b0c12720a4801764084fe394f38ecc7be3 authorElliot Cameron <eacameron@gmail.com> dateTue 24 Dec 2019, 23:59 (7 years ago) parentcaf0ae1
1 file changed+10
lib/command/src/Obelisk/Command/Utils.hs+10
lib/command/src/Obelisk/Command/Utils.hs+10
@@ -70,6 +70,16 @@ gitProc repo = gitProcNoRepo . runGitInDir
7070 args@("clone":_) -> args <> [repo]
7171 args -> ["-C", repo] <> args
7272
73+isolateGitProc :: ProcessSpec -> ProcessSpec
74+isolateGitProc = setEnvOverride (overrides <>)
75+ where
76+ overrides = M.fromList
77+ [ ("HOME", "/dev/null")
78+ , ("GIT_CONFIG_NOSYSTEM", "1")
79+ , ("GIT_TERMINAL_PROMPT", "0")
80+ , ("GIT_SSH_COMMAND", "ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no -o GSSAPIAuthentication=no")
81+ ]
82+
7383-- | Recursively copy a directory using `cp -a` -- TODO: Should use -rT instead of -a
7484copyDir :: FilePath -> FilePath -> ProcessSpec
7585copyDir src dest =