diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de12a59a..14468d0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,7 +61,6 @@ jobs: test-os: name: Test on ${{ matrix.os }} - needs: test timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: diff --git a/lib/src/services/flutter_service.dart b/lib/src/services/flutter_service.dart index 9fbaebdd..af5521fb 100644 --- a/lib/src/services/flutter_service.dart +++ b/lib/src/services/flutter_service.dart @@ -198,8 +198,8 @@ class FlutterService extends ContextService { throw Exception('Git cache directory does not exist'); } - final gitDir = await GitDir.fromExisting(context.gitCachePath); try { + final gitDir = await GitDir.fromExisting(context.gitCachePath); final result = await gitDir.runCommand( ['rev-parse', '--short', '--verify', ref], ); diff --git a/lib/src/workflows/resolve_dependencies.workflow.dart b/lib/src/workflows/resolve_dependencies.workflow.dart index 018d40f3..1fba8932 100644 --- a/lib/src/workflows/resolve_dependencies.workflow.dart +++ b/lib/src/workflows/resolve_dependencies.workflow.dart @@ -27,6 +27,14 @@ Future 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 diff --git a/lib/src/workflows/use_version.workflow.dart b/lib/src/workflows/use_version.workflow.dart index 71ecda2e..504ffc69 100644 --- a/lib/src/workflows/use_version.workflow.dart +++ b/lib/src/workflows/use_version.workflow.dart @@ -33,12 +33,25 @@ Future 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 @@ -111,12 +124,6 @@ Future _checkGitignore(Project project, {required bool force}) async { final updateGitIgnore = project.config?.updateGitIgnore ?? true; logger.detail('Update gitignore: $updateGitIgnore'); - if (!await GitDir.isGitDir(project.path)) { - logger.warn( - 'Project is not a git repository. \n But will set .gitignore as IDEs may use it,' - 'to determine what to index and display on searches,', - ); - } if (!updateGitIgnore) { logger.detail( @@ -131,6 +138,12 @@ Future _checkGitignore(Project project, {required bool force}) async { final ignoreFile = project.gitIgnoreFile; if (!ignoreFile.existsSync()) { + if (!await GitDir.isGitDir(project.path)) { + logger.warn( + 'Project is not a git repository. \n But will set .gitignore as IDEs may use it,' + 'to determine what to index and display on searches,', + ); + } ignoreFile.createSync(recursive: true); }