From 7a8b906c1c0ce4d1c999cb62ea81a3f911153d9e Mon Sep 17 00:00:00 2001 From: leoafarias Date: Mon, 27 Jul 2020 05:37:28 -0400 Subject: [PATCH] version bump and fvm config path adjustment --- CHANGELOG.md | 5 +++++ lib/constants.dart | 14 ++++---------- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1868b8..c5279079 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.1.4 + +- Nested FVM config look up, to be used on monorepo projects, or nested directories. +- Added link to changelog on upgrade message. + ## 1.1.3 - Removed Flutter project guard from flutter proxy command diff --git a/lib/constants.dart b/lib/constants.dart index 917bb582..a80fb66b 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -13,8 +13,7 @@ final kFvmDirectory = Platform.script.toString(); final kWorkingDirectory = Directory.current; /// Local Project Directory -final kProjectFvmDir = - Directory(path.join(_getProjectFvmDir().path, kFvmDirName)); +final kProjectFvmDir = _getProjectFvmDir(); // Local project look up on nested project folders (monorepo) Directory _getProjectFvmDir({Directory dir}) { @@ -25,17 +24,12 @@ Directory _getProjectFvmDir({Directory dir}) { if (flutterProjectDir.existsSync()) return flutterProjectDir; // Return working directory if it has reached root - if (isRootDir) return kWorkingDirectory; + if (isRootDir) { + return Directory(path.join(kWorkingDirectory.path, kFvmDirName)); + } return _getProjectFvmDir(dir: dir.parent); } -Directory getProjectPath(Directory dir) { - var dir = kProjectFvmDir; - - if (dir.existsSync()) return dir; - return getProjectPath(dir.parent); -} - /// Local Project Config final kProjectFvmConfigJson = File(path.join(kProjectFvmDir.path, 'fvm_config.json')); diff --git a/pubspec.yaml b/pubspec.yaml index 3b6e729f..3fada05e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fvm description: A simple cli to manage Flutter SDK versions per project. Support channels, releases, and local cache for fast switching between versions. -version: 1.1.3 +version: 1.1.4 homepage: https://github.com/leoafarias/fvm environment: