stacked
stacked copied to clipboard
[bug]: Local activation of stacked-cli on windows throws format exception
Describe the bug
According to here https://github.com/Stacked-Org/cli#running-the-code I activated a local fork of the stacked-cli with dart pub global activate --source path .
. But when I want to use the local version it fails with the error FormatException: Could not parse ""C:\Users\myUser\Dev\Flutter\cli"".
To reproduce
- Open local fork of the stacked-cli
- Register it:
dart pub global activate --source path .
- Try to create a new app:
stacked create app testapp
- Receive
FormatException: Could not parse ""C:\Users\myUser\Dev\Flutter\cli"".
Expected behavior
Throw no error.
Screenshots
No response
Additional Context
stacked --version
gives me as a result "C:\Users\myUser\Dev\Flutter\cli"
.
The runPubGloablList
returns for me [stacked 3.4.1, stacked_cli 1.10.0 at path "C:\Users\myUser\Dev\Flutter\cli"]
and thus the parsing of the version of the package fails.
If I change in pub_services.dart
from:
version = package.split(' ').last()
To:
version = package.split(' ').elementAt(1);
It works again for me. Would that work on other systems as well?
Are you trying to install Stacked CLI for development ?
Are you trying to install Stacked CLI for development ?
Yes, as described here: https://github.com/Stacked-Org/cli#running-the-code
It does not appear when installing it regularly as a consumer.
I'm using a Windows platform.
I will review this documentation during the week, but I'm not using the CLI that way for development. You can do the following on the root of the CLI repository:
dart run bin/stacked.dart create app my_app
Modify the command to do what you want.
I will review this documentation during the week, but I'm not using the CLI that way for development. You can do the following on the root of the CLI repository:
dart run bin/stacked.dart create app my_app
Modify the command to do what you want.
That explains why you have not encountered this bug. Sure, works as well. Just wanted to add that this fix would enable both ways to work.