Merge pull request #399 from tuist/env-version

[env-version] added version command with envversion
This commit is contained in:
Oliver Atkinson 2019-06-08 22:53:16 +01:00 committed by GitHub
commit fdbb740103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
### Added
- `DefaultSettings.none` to disable the generation of default build settings https://github.com/tuist/tuist/pull/395 by @pepibumur.
- Version information for tuistenv https://github.com/tuist/tuist/pull/399 by @ollieatkinson
### Fixed

View File

@ -22,6 +22,7 @@ public final class CommandRegistry {
UpdateCommand.self,
InstallCommand.self,
UninstallCommand.self,
VersionCommand.self,
])
}

View File

@ -0,0 +1,32 @@
import Basic
import Foundation
import SPMUtility
import TuistCore
class VersionCommand: NSObject, Command {
// MARK: - Command
static let command = "envversion"
static let overview = "Outputs the current version of tuist env."
// MARK: - Attributes
let printer: Printing
// MARK: - Init
required init(parser: ArgumentParser) {
parser.add(subparser: VersionCommand.command, overview: VersionCommand.overview)
printer = Printer()
}
init(printer: Printing) {
self.printer = printer
}
// MARK: - Command
func run(with _: ArgumentParser.Result) {
printer.print(Constants.version)
}
}

View File

@ -93,6 +93,15 @@ Installing...
Version 0.4.0 installed
```
### tuist envversion
To check the current installed version of `tuistenv`, the command is:
```sh
tuist envversion
0.15.0
```
## Running Tuist
As we mentioned earlier, Tuist version management works **transparently**. Any of the commands mentioned above are necessary to use Tuist.