justinwoo / spago2nix

Generate a derivation of (old) Spago dependencies, and use them to install them into the directory structure used by Spago.
MIT License
42 stars 22 forks source link

fails when the installed version of spago > 0.12.1 #26

Closed Benjmhart closed 4 years ago

Benjmhart commented 4 years ago

with the latest release of spago, installed through npm, the output of spago2nix generate is

getting packages..
got 6 packages from Spago list-packages.
(JSONError "ForeignError: Unexpected token U in JSON at position 0")

this is likely due to the command change to spago ls packages

Benjmhart commented 4 years ago

current workaround is to temporarily install an older version of spago to run the spago2nix generate command or possibly to use a lower version of spago as a project dependency and wrap spago2nix generateas an npm script

justinwoo commented 4 years ago

could you please make a PR where you make the change here (https://github.com/justinwoo/spago2nix/blob/32ba33ce8d18648a1c47d4388323a3e115f552dd/src/Generate.purs#L48) and update the bin script?

Benjmhart commented 4 years ago

@Justinwoo - I'm happy to make the PR, however isn't it a better choice to detect the version of spago upfront and change the command based on the version?

justinwoo commented 4 years ago

i think you can really just make some assumptions about the latest version being used and just put it in some changelog as needed. most usages will end up using easy-purescript-nix and such to lock down versions in any case