Hi everyone!
Does anyone know how to make nimscript run a task that's basically after the dependencies are installed, but before the current library is installed by nimble? My use case is the following:
# Package
version = "0.1.0"
author = "Joey Payne"
description = "Nintendo Switch library libnx for Nim."
license = "The Unlicense"
srcDir = "src"
# Deps
requires "nim >= 0.18.0", "https://github.com/jyapayne/nimgenEx#head"
task setup, "Download and generate":
exec "nimgen libnxGen.cfg" # I want this to run after deps are installed because nimgen doesn't exist yet
before install:
setupTask()
When I run it now, I get an error:
sh: 1: nimgen: not found
stack trace: (most recent call last)
home/joey/Projects/nim-libnx/libnx.nimble(17) installBefore
home/joey/Projects/nim-libnx/libnx.nimble(14) setupTask
home/joey/Nim/lib/system/nimscript.nim(237) exec
home/joey/Nim/lib/system/nimscript.nim(237, 7) Error: unhandled exception: FAILED: nimgen libnxGen.cfg
because obviously nimgen doesn't exist yet because it's not installed. However, if I first install it, it works fine. But I don't think that's a reasonable flow to first ask the user to install nimgen and then use the library.
Is there an option in nimscript I'm missing?
There is already an issue when using nimgen with Nimble due to a bug in Nimble with how it handles the before install tasks. I guess this is another bug that we need to fix.
Here is the relevant PR that fixes another bug related to this: https://github.com/nim-lang/nimble/pull/464