Skip to content

fvm wrapper fails to install dependencies #129

@toonvanstrijp

Description

@toonvanstrijp

Description of the bug

When using the fvm wrapper it fails to install the dependencies. This is caused because it's executing the wrong command. This is seen below in the logs:

[INFO] openapi_generator on lib/api.config.dart:Installing dependencies with generated source. fvm pub get

[SEVERE] openapi_generator on lib/api.config.dart:
Failed to generate content.

Install within generated sources failed.  #0      OpenapiGenerator.fetchDependencies (package:openapi_generator/src/openapi_generator_runner.dart:406:36)
<asynchronous suspension>
#1      OpenapiGenerator.generatorV2 (package:openapi_generator/src/openapi_generator_runner.dart:171:9)
<asynchronous suspension>
#2      normalizeGeneratorOutput (package:source_gen/src/output_helpers.dart:10:1)
<asynchronous suspension>
#3      StreamCompleter.se

Steps to reproduce

To reproduce this issue you can use the following config:

@Openapi(
  additionalProperties: AdditionalProperties(
    pubName: 'hycare_api',
    enumUnknownDefaultCase: true,
    wrapper: Wrapper.fvm,
  ),
  inputSpec: RemoteSpec(
    path: "http://localhost:3000/docs-json",
  ),
  cachePath: ".dart_tool/build/openapi_cache.json",
  generatorName: Generator.dio,
  runSourceGenOnOutput: true,
  outputDirectory: 'api',
)

Now simply run the fvm flutter pub run build_runner build --delete-conflicting-outputs and you can see it fails to install.

Expected behavior

I would expect that when the fvm wrapper is used the install command looks like fvm flutter pub get.

Logs

No response

Screenshots

No response

Platform

macOS

Library version

5.0.2

Flutter version

3.16.4

Flutter channel

stable

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions