Skip to content

Commit

Permalink
feat(cli): finalize minimal cli
Browse files Browse the repository at this point in the history
  • Loading branch information
pedraal committed Aug 22, 2024
1 parent 25eb92e commit 9b59bc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/releam.gleam
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import gleam/io
import gleam/option.{None, Some}
import gleamsver as gs
import releam/changelog
Expand Down Expand Up @@ -42,9 +41,8 @@ pub fn main() {

let assert Ok(_) = changelog.write_to_changelog_file(new_changelog)

// let assert Ok(_) = git.commit_release(new_tag)
let new_config = package_config.replace_version(raw_config, new_version)
let assert Ok(_) = simplifile.write("gleam.toml", new_config)

io.println("Changelog:")
changelog.render(new_changelog, False)
|> io.debug
let assert Ok(_) = git.commit_release(new_tag)
}
4 changes: 3 additions & 1 deletion src/releam/git.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ pub fn get_commits_since_last_tag(tag: String) {
}

pub fn commit_release(new_tag: String) {
let assert Ok(_) = exec_git(["add", changelog.changelog_file_path])
let assert Ok(_) =
exec_git(["add", changelog.changelog_file_path, "gleam.toml"])
let assert Ok(_) = exec_git(["commit", "-m", "chore(release): " <> new_tag])
let assert Ok(_) = exec_git(["tag", "-am", new_tag, new_tag])
let assert Ok(_) = exec_git(["push", "--follow-tags"])
}

pub fn exec_git(args: List(String)) {
Expand Down

0 comments on commit 9b59bc8

Please sign in to comment.