diff --git a/CHANGELOG.md b/CHANGELOG.md index c11966e..fc6a9c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.7.1] - 2023-02-05 + +### Fixed + +- Failing to hot update or remove Lip in local directory. + ## [0.7.0] - 2023-02-01 ### Added @@ -115,17 +121,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Basic functions: cache, install, list, show, tooth init, and uninstall. -[unreleased]: https://github.com/LiteLDev/Lip/compare/v0.7.0...HEAD -[0.7.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.6.0...v0.7.0 -[0.6.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.5.1...v0.6.0 -[0.5.1]: https://github.com/LiteLDev/Lip/releases/tag/v0.4.0...v0.5.1 -[0.5.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.4.0...v0.5.0 -[0.4.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.3.4...v0.4.0 -[0.3.4]: https://github.com/LiteLDev/Lip/releases/tag/v0.3.3...v0.3.4 -[0.3.3]: https://github.com/LiteLDev/Lip/releases/tag/v0.3.2...v0.3.3 -[0.3.2]: https://github.com/LiteLDev/Lip/releases/tag/v0.3.1...v0.3.2 -[0.3.1]: https://github.com/LiteLDev/Lip/releases/tag/v0.3.0...v0.3.1 -[0.3.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.2.1...v0.3.0 -[0.2.1]: https://github.com/LiteLDev/Lip/releases/tag/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.1.0...v0.2.0 +[unreleased]: https://github.com/LiteLDev/Lip/compare/v0.7.1...HEAD +[0.7.1]: https://github.com/LiteLDev/Lip/compare/v0.7.0...v0.7.1 +[0.7.0]: https://github.com/LiteLDev/Lip/compare/v0.6.0...v0.7.0 +[0.6.0]: https://github.com/LiteLDev/Lip/compare/v0.5.1...v0.6.0 +[0.5.1]: https://github.com/LiteLDev/Lip/compare/v0.4.0...v0.5.1 +[0.5.0]: https://github.com/LiteLDev/Lip/compare/v0.4.0...v0.5.0 +[0.4.0]: https://github.com/LiteLDev/Lip/compare/v0.3.4...v0.4.0 +[0.3.4]: https://github.com/LiteLDev/Lip/compare/v0.3.3...v0.3.4 +[0.3.3]: https://github.com/LiteLDev/Lip/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/LiteLDev/Lip/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/LiteLDev/Lip/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/LiteLDev/Lip/compare/v0.2.1...v0.3.0 +[0.2.1]: https://github.com/LiteLDev/Lip/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/LiteLDev/Lip/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.1.0 diff --git a/src/cmd/install/install.go b/src/cmd/install/install.go index fca0fd5..b763cd0 100644 --- a/src/cmd/install/install.go +++ b/src/cmd/install/install.go @@ -217,6 +217,7 @@ func Run() { for _, specifier := range specifiers { // If the specifier is not a requirement specifier, skip. if specifier.Type() != RequirementSpecifierType { + logger.Error("the specifier " + specifier.String() + " is not a requirement specifier. It cannot be used with the force-reinstall flag or the upgrade flag") continue } diff --git a/src/main.go b/src/main.go index 4a03fac..94e6085 100644 --- a/src/main.go +++ b/src/main.go @@ -33,16 +33,19 @@ func main() { err = localfile.Init() if err != nil { logger.Error(err.Error()) + os.Exit(1) } // Change the working directory to the project root. workspaceDir, err := localfile.WorkSpaceDir() if err != nil { logger.Error(err.Error()) + os.Exit(1) } err = os.Chdir(workspaceDir) if err != nil { logger.Error(err.Error()) + os.Exit(1) } // Attempt to execute .lip/tools/lip or .lip/tools/lip.exe if it exists. @@ -52,6 +55,21 @@ func main() { lipExeName = "lip.exe" } + // Remove {lipExeName} and lip.remove if they exist. + if _, err := os.Stat(".lip/tools/lip/lip.remove"); err == nil { + logger.Info("Removing .lip/tools/lip/" + lipExeName + " and .lip/tools/lip/lip.remove") + err = os.Remove(".lip/tools/lip/" + lipExeName) + if err != nil { + logger.Error("failed to remove old Lip version: " + err.Error()) + os.Exit(1) + } + err = os.Remove(".lip/tools/lip/lip.remove") + if err != nil { + logger.Error("failed to remove old Lip version: " + err.Error()) + os.Exit(1) + } + } + // Move lip.update to {lipExeName} if it exists. if _, err := os.Stat(".lip/tools/lip/lip.update"); err == nil { logger.Info("Moving .lip/tools/lip/lip.update to .lip/tools/lip/" + lipExeName) @@ -61,6 +79,7 @@ func main() { err = os.Remove(".lip/tools/lip/" + lipExeName) if err != nil { logger.Error("failed to remove old Lip version: " + err.Error()) + os.Exit(1) } } @@ -68,6 +87,7 @@ func main() { err = os.Rename(".lip/tools/lip/lip.update", ".lip/tools/lip/"+lipExeName) if err != nil { logger.Error("failed to move new Lip version: " + err.Error()) + os.Exit(1) } }