From 9b59bc858c17f10ee8f1317877adfbf31d8f9aed Mon Sep 17 00:00:00 2001 From: pedraal Date: Fri, 23 Aug 2024 01:46:29 +0200 Subject: [PATCH] feat(cli): finalize minimal cli --- src/releam.gleam | 8 +++----- src/releam/git.gleam | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/releam.gleam b/src/releam.gleam index f4b9f3f..028a597 100644 --- a/src/releam.gleam +++ b/src/releam.gleam @@ -1,4 +1,3 @@ -import gleam/io import gleam/option.{None, Some} import gleamsver as gs import releam/changelog @@ -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) } diff --git a/src/releam/git.gleam b/src/releam/git.gleam index 619df7e..5d6b5e2 100644 --- a/src/releam/git.gleam +++ b/src/releam/git.gleam @@ -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)) {