Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignite --Version fails to work #8

Open
munsterlander opened this issue Aug 19, 2022 · 2 comments
Open

Ignite --Version fails to work #8

munsterlander opened this issue Aug 19, 2022 · 2 comments
Assignees

Comments

@munsterlander
Copy link

Installed per the instructions:

flutter pub global activate ignite_cli
Resolving dependencies...
+ args 2.3.1
+ charcode 1.3.1
+ collection 1.16.0
+ ignite_cli 0.4.0
+ io 1.0.3
+ logging 1.0.2
+ meta 1.8.0
+ path 1.8.2
+ process_run 0.12.3+2
+ prompts 2.0.0
+ pub_semver 2.1.1
+ source_span 1.9.1
+ string_scanner 1.1.1
+ synchronized 3.0.0+2
+ term_glyph 1.2.1
+ yaml 3.1.1
Building package executables...
Built ignite_cli:ignite.
Installed executable ignite.
Activated ignite_cli 0.4.0.

Running ignite --version as per the pub.dev instructions throws:

ignite --version
$ ignite --version:
Unhandled exception:
FileSystemException: Cannot open file, path = 'C:\flutter\flutter\.pub-cache\global_packages\ignite_cli\bin\..\pubspec.yaml' (OS Error: The system cannot find the file specified.
, errno = 2)
#0      _File.open.<anonymous closure> (dart:io/file_impl.dart:356:9)
<asynchronous suspension>
#1      getVersionFromPubspec (package:ignite_cli/commands/version_command.dart:19:25)
<asynchronous suspension>
#2      versionCommand (package:ignite_cli/commands/version_command.dart:10:9)
<asynchronous suspension>
#3      mainCommand (package:ignite_cli/main.dart:59:5)
<asynchronous suspension>
No active package ignite_cli.

Yet ignite create works fine.

@luanpotter
Copy link
Member

This is an issue because we cannot access the pubpsec file when installed globally. See my issue here

If you run --version locally or on a non-global context, it would work.

@spydon
Copy link
Member

spydon commented Dec 8, 2023

We should either use this to lookup the pubspec file to get the version or generate the version at build-time like Melos does:
https://github.com/invertase/melos/blob/main/packages/melos/lib/src/command_runner.dart#L102
https://github.com/invertase/melos/blob/main/packages/melos/lib/version.g.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants