pass GITHUB_TOKEN to hub when cloning nixpkgs

This commit is contained in:
Jan Tojnar 2019-01-18 08:57:42 +01:00
parent 42ef72dcbb
commit f767bffb02
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 7 additions and 4 deletions

View File

@ -56,7 +56,7 @@ main = do
mode <- Opt.execParser programInfo
options <- makeOptions
updates <- T.readFile "packages-to-update.txt"
setupNixpkgs
setupNixpkgs options
case mode of
DeleteDone -> deleteDone options
Update -> updateAll options updates

View File

@ -74,12 +74,15 @@ runtimeDir = do
Right dir -> return dir
Left e -> error $ T.unpack e
setupNixpkgs :: IO ()
setupNixpkgs = do
setupNixpkgs :: Options -> IO ()
setupNixpkgs o = do
fp <- getUserCacheDir "nixpkgs"
exists <- doesDirectoryExist fp
unless exists $ do
_ <- shelly $ run "hub" ["clone", "nixpkgs", T.pack fp] -- requires that user has forked nixpkgs
_ <-
shelly $ do
setenv "GITHUB_TOKEN" (githubToken o)
run "hub" ["clone", "nixpkgs", T.pack fp] -- requires that user has forked nixpkgs
setCurrentDirectory fp
_ <-
shelly $