We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98ca24d commit cc6699bCopy full SHA for cc6699b
nix-tools/stack2nix/Stack2nix/Stack.hs
@@ -163,9 +163,17 @@ pkgIndex = PkgIndex <$> parse <*> suffix <* eof
163
-- JSON/YAML destructors
164
165
instance FromJSON Location where
166
- parseJSON = withObject "Location" $ \l -> Git
167
- <$> l .: "git"
168
- <*> l .: "commit"
+ parseJSON = withObject "Location" $ \l ->
+ parseGitHub l <|> parseGit l
+ where
169
+ parseGit l = Git
170
+ <$> l .: "git"
171
+ <*> l .: "commit"
172
+ parseGitHub l = Git
173
+ <$> do gitHubUrl <$> l .: "github"
174
175
+ gitHubUrl ownerRepo =
176
+ "https://github.com/" <> ownerRepo <> ".git"
177
178
instance FromJSON Stack where
179
parseJSON = withObject "Stack" $ \s -> Stack
0 commit comments