on master help sign in
No longer track whether the GitHub repo is private
d00a4d7John Ericson
lib/command/src/Obelisk/Command/Project.hs−1
@@ -48,7 +48,6 @@ obeliskSourceWithBranch branch = ThunkSource_GitHub $ GitHubSource
48 { _gitHubSource_owner = "obsidiansystems"
48 { _gitHubSource_owner = "obsidiansystems"
49 , _gitHubSource_repo = "obelisk"
49 , _gitHubSource_repo = "obelisk"
50 , _gitHubSource_branch = Just branch
50 , _gitHubSource_branch = Just branch
51− , _gitHubSource_private = False
52 }
51 }
53
52
54data InitSource
53data InitSource
lib/command/src/Obelisk/Command/Thunk.hs−9
@@ -113,7 +113,6 @@ data GitHubSource = GitHubSource
113 { _gitHubSource_owner :: Name Owner
113 { _gitHubSource_owner :: Name Owner
114 , _gitHubSource_repo :: Name Repo
114 , _gitHubSource_repo :: Name Repo
115 , _gitHubSource_branch :: Maybe (Name Branch)
115 , _gitHubSource_branch :: Maybe (Name Branch)
116− , _gitHubSource_private :: Bool
117 }
116 }
118 deriving (Show, Eq, Ord)
117 deriving (Show, Eq, Ord)
119
118
@@ -300,12 +299,10 @@ parseGitHubSource v = do
300 owner <- v Aeson..: "owner"
299 owner <- v Aeson..: "owner"
301 repo <- v Aeson..: "repo"
300 repo <- v Aeson..: "repo"
302 branch <- v Aeson..:! "branch"
301 branch <- v Aeson..:! "branch"
303− mPrivate <- v Aeson..:! "private"
304 pure $ GitHubSource
302 pure $ GitHubSource
305 { _gitHubSource_owner = owner
303 { _gitHubSource_owner = owner
306 , _gitHubSource_repo = repo
304 , _gitHubSource_repo = repo
307 , _gitHubSource_branch = branch
305 , _gitHubSource_branch = branch
308− , _gitHubSource_private = fromMaybe False mPrivate
309 }
306 }
310
307
311parseGitSource :: Aeson.Object -> Aeson.Parser GitSource
308parseGitSource :: Aeson.Object -> Aeson.Parser GitSource
@@ -341,9 +338,6 @@ encodeThunkPtrData (ThunkPtr rev src) = case src of
341 [ Just $ "owner" .= _gitHubSource_owner s
338 [ Just $ "owner" .= _gitHubSource_owner s
342 , Just $ "repo" .= _gitHubSource_repo s
339 , Just $ "repo" .= _gitHubSource_repo s
343 , ("branch" .=) <$> _gitHubSource_branch s
340 , ("branch" .=) <$> _gitHubSource_branch s
344− , if _gitHubSource_private s
345− then Just $ "private" .= True
346− else Nothing
347 , Just $ "rev" .= Ref.toHexString (_thunkRev_commit rev)
341 , Just $ "rev" .= Ref.toHexString (_thunkRev_commit rev)
348 , Just $ "sha256" .= _thunkRev_nixSha256 rev
342 , Just $ "sha256" .= _thunkRev_nixSha256 rev
349 ]
343 ]
@@ -761,8 +755,6 @@ githubThunkPtr owner' repo' commit = do
761 let owner = N (T.pack owner')
755 let owner = N (T.pack owner')
762 repo = N (T.pack (dropExtension repo'))
756 repo = N (T.pack (dropExtension repo'))
763 mauth <- liftIO $ getHubAuth "github.com"
757 mauth <- liftIO $ getHubAuth "github.com"
764− repoResult <- liftIO $ executeRequestMaybe mauth $ repositoryR owner repo
765− repoIsPrivate <- either (liftIO . throwIO) (return . repoPrivate) repoResult
766 archiveResult <- liftIO $ executeRequestMaybe mauth $
758 archiveResult <- liftIO $ executeRequestMaybe mauth $
767 archiveForR owner repo ArchiveFormatTarball (Just commit)
759 archiveForR owner repo ArchiveFormatTarball (Just commit)
768 archiveUri <- either (liftIO . throwIO) return archiveResult
760 archiveUri <- either (liftIO . throwIO) return archiveResult
@@ -776,7 +768,6 @@ githubThunkPtr owner' repo' commit = do
776 { _gitHubSource_owner = owner
768 { _gitHubSource_owner = owner
777 , _gitHubSource_repo = repo
769 , _gitHubSource_repo = repo
778 , _gitHubSource_branch = N <$> mbranch
770 , _gitHubSource_branch = N <$> mbranch
779− , _gitHubSource_private = repoIsPrivate
780 }
771 }
781 }
772 }
782
773