Closed thomashoneyman closed 1 year ago
If you check before this change you'll see that attempting to read the Dhall directory fails (incorrect path); attempting to read the .env file fails silently (you just get a "not found" for each env variable in it rather than an outright crash); you'll see that the scratch
dir is incorrectly created in the various script directories.
I think for the time being I'd prefer to unify the scripts in the scripts
dir to be one package and run it with -m
. Open to other things for the long term. What do you think?
Note that this implies that the API
module would end up there too (so option 1 is very similar to option 3), I was under the impression that you wanted to have that separate from the legacy scripts?
Ah well right, the scripts don't have to be together with the API module, it's enough that they are at the same level of nesting
So yeah, this sounds good to me!
Note that this implies that the
API
module would end up there too (so option 1 is very similar to option 3), I was under the impression that you wanted to have that separate from the legacy scripts?
If the scripts
directory becomes:
scripts/LegacyImport.purs
scripts/PackageTransferrer.purs
scripts/spago.yaml
...then that solves the problem because the nesting becomes even with the API.
Oh, I see you already commented that. Cool -- I'll go ahead with the change.
@f-f The various CI jobs are currently failing because the scripts and
registry-api
utility expect to be executed from the root of the repository (for example,DotEnv.loadFile
expects there to be a.env
file in the current directory; we also expect the current directory to contain thescratch
dir,.cache
directory, and so on). However, in the new monorepo setup Spago is executing in the context of the individual packages so the paths are no longer correct.I've fixed this by ensuring that we refer to the
scratch
,.cache
directories and the.env
file in their proper location (the root). However, question for you: to get to the root I'm having to do../../
, but I would expect Spago to execute with thecwd
being the directory containing thespago.yaml
file. Is this expected? If not, it's an easy change on our side (just changerootDir
).