Skip to content

Commit

Permalink
Better message for behavior on pubspec
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed May 31, 2024
1 parent c803bfb commit 8dcfc7c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
8 changes: 8 additions & 0 deletions lib/src/workflows/resolve_dependencies.workflow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ Future<void> resolveDependenciesWorkflow(
return;
}

if (!project.hasPubspec) {
logger
..info('Skipping "pub get" because no pubspec.yaml found.')
..spacer;

return;
}

final progress = logger.progress('Resolving dependencies...');

// Try to resolve offline
Expand Down
23 changes: 18 additions & 5 deletions lib/src/workflows/use_version.workflow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,25 @@ Future<void> useVersionWorkflow({
}) async {
// If project use check that is Flutter project
if (!project.hasPubspec && !force) {
logger
..spacer
..info('No pubspec.yaml detected in this directory');
final proceed = logger.confirm('Would you like to continue?');
if (project.hasConfig) {
if (project.path != ctx.workingDirectory) {
logger
..spacer
..info('Using $kFvmConfigFileName in ${project.path}')
..spacer
..info(
'If this is incorrect either use the --force flag or remove the $kFvmConfigFileName and the $kFvmDirName directory.',
)
..spacer;
}
} else {
logger
..spacer
..info('No pubspec.yaml detected in this directory');
final proceed = logger.confirm('Would you like to continue?');

if (!proceed) exit(ExitCode.success.code);
if (!proceed) exit(ExitCode.success.code);
}
}

logger
Expand Down

0 comments on commit 8dcfc7c

Please sign in to comment.