Skip to content

Commit 0c0cf3f

Browse files
Merge pull request #37 from Ether-CLI/develop
2018.10.03
2 parents ba553ca + be9e145 commit 0c0cf3f

File tree

8 files changed

+44
-5
lines changed

8 files changed

+44
-5
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [2018.10.03]
2+
3+
### Added
4+
- `new-commit` configuration for auto committing when a new project is generated.
5+
- `update-commit` configuration for auto committing when a project's packages are updated.
6+
- `version-latest-commit` configuration for auto committing when a project's dependencies are all updated to their latest versions.
7+
- `version-set-commit` configuration for auto committing when a project's dependency's version is updated.
8+
9+
### Fixed
10+
- JSON key used to get license info during package search
11+
112
## [2018.09.08]
213

314
### Added

Sources/Ether/Configuration.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ public class Configuration: Command {
3232
CommandArgument.argument(name: "key", help: [
3333
"The configuration JSON key to set",
3434
"Valid keys are:",
35-
"- access-token: The GitHub access token to use for interacting the the GraphQL API. You can create on at https://github.com/settings/token",
35+
"- access-token: The GitHub access token to use for interacting the the GraphQL API. You can create one at https://github.com/settings/token",
3636
"- install-commit: The commit message to use on package install. Use '&0' as package name placeholder",
37-
"- remove-commit: The commit message to use on when a package is removed. Use '&0' as package name placeholder",
37+
"- remove-commit: The commit message to use when a package is removed. Use '&0' as package name placeholder",
38+
"- new-commit: The commit message to use when a new project is generated. Use '&0' as the project name placeholder",
39+
"- update-commit: The commit message to use when a project's packages are updated",
40+
"- version-latest-commit: The commit message to use when you update a project's dependencies to their latest versions",
41+
"- version-set-commit: The commit message to use when you set a project's dependency to a specific version. Use '&0' as the package name and '&1' as the package's new version placeholders",
3842
"- signed-commits: If set to a truthy value (true, yes, y, 1), auto-commits will pass in the '-S' flag"
3943
]),
4044
CommandArgument.argument(name: "value", help: ["The new value for the key passed in. If no value is passed in, the key will be removed from the config"])
@@ -112,12 +116,20 @@ public struct Config: Codable, Reflectable {
112116
public var accessToken: String?
113117
public var installCommit: String?
114118
public var removeCommit: String?
119+
public var newCommit: String?
120+
public var updateCommit: String?
121+
public var latestVersionCommit: String?
122+
public var versionSetCommit: String?
115123
public var signedCommits: String?
116124

117125
static let properties: [String: WritableKeyPath<Config, String?>] = [
118126
"access-token": \.accessToken,
119127
"install-commit": \.installCommit,
120128
"remove-commit": \.removeCommit,
129+
"new-commit": \.newCommit,
130+
"update-commit": \.updateCommit,
131+
"version-latest-commit": \.latestVersionCommit,
132+
"version-set-commit": \.versionSetCommit,
121133
"signed-commits": \.signedCommits
122134
]
123135

Sources/Ether/New.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public final class New: Command {
5151
}
5252

5353
newProject.succeed()
54+
55+
let config = try Configuration.get()
56+
let name = try context.argument("name")
57+
try config.commit(with: config.newCommit, on: context, replacements: [name])
58+
5459
return context.container.future()
5560
}
5661

Sources/Ether/Search.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public final class Search: Command {
7070
struct PackageDescription: Codable {
7171
let nameWithOwner: String
7272
let description: String?
73-
let license: String?
73+
let licenseInfo: String?
7474
let stargazers: Int?
7575

7676
func print(on context: CommandContext) {
@@ -81,7 +81,8 @@ struct PackageDescription: Codable {
8181
context.console.info(self.nameWithOwner)
8282
}
8383

84-
if let license = self.license {
84+
if let licenseInfo = self.licenseInfo {
85+
let license = licenseInfo == "NOASSERTION" ? "Unknown" : licenseInfo
8586
context.console.print("License: " + license)
8687
}
8788

Sources/Ether/Update.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public final class Update: Command {
5454

5555
updating.succeed()
5656

57+
let config = try Configuration.get()
58+
try config.commit(with: config.updateCommit, on: context, replacements: [])
59+
5760
if context.options["xcode"] != nil {
5861
let xcode = context.console.loadingBar(title: "Generating Xcode Project")
5962
_ = xcode.start(on: context.container)

Sources/Ether/Version/VersionLatest.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public final class VersionLatest: Command {
7878
_ = try Process.execute("swift", "package", "update")
7979
updating.succeed()
8080

81+
let config = try Configuration.get()
82+
try config.commit(with: config.latestVersionCommit, on: context, replacements: [])
83+
8184
if let _ = context.options["xcode"] {
8285
let xcodeBar = context.console.loadingBar(title: "Generating Xcode Project")
8386
_ = xcodeBar.start(on: context.container)

Sources/Ether/Version/VersionSet.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public final class VersionSet: Command {
6464
_ = try Process.execute("swift", "package", "update")
6565
updating.succeed()
6666

67+
let config = try Configuration.get()
68+
try config.commit(with: config.versionSetCommit, on: context, replacements: [package, version])
69+
6770
if let _ = context.options["xcode"] {
6871
let xcodeBar = context.console.loadingBar(title: "Generating Xcode Project")
6972
_ = xcodeBar.start(on: context.container)

publish.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ git add .
6666
git commit -S -m "Updated Ether version to $TAG"
6767
git push origin master
6868
cd ../
69-
7069
rm -rf homebrew-tap
70+
71+
cd Ether/
7172
rm -rf macOS-sierra.tar.gz
7273
rm -rf $PACKAGE_NAME
7374
rm install

0 commit comments

Comments
 (0)