8000 Require Inko 0.17.0 or newer · yorickpeterse/clogs@7f9a007 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Require Inko 0.17.0 or newer
Browse files Browse the repository at this point in the history
Changelog: changed
  • Loading branch information
yorickpeterse committed Oct 28, 2024
1 parent 33983e4 commit 7f9a007
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ changelog.

## Requirements

- Inko 0.15.0 or newer
- Inko 0.17.0 or newer
- Git

Generating changelogs comes with the following workflow requirements:
Expand Down
8 changes: 2 additions & 6 deletions src/clogs/cli.inko
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import clogs.changelog (Changelog, Release)
import clogs.config (CONFIG_FILE, Config)
import clogs.git (Commit, Repository)
import clogs.git (Repository)
import clogs.version (Version)
import std.fs.file (ReadOnlyFile, WriteOnlyFile)
import std.fs.path (Path)
import std.io (Write)
import std.optparse (Help, Matches, Options)
import std.set (Set)
import std.string (StringBuffer)
import std.sys (exit)
import std.optparse (Help, Options)
import std.time (DateTime)

let VERSION = '0.5.0'
Expand Down
21 changes: 12 additions & 9 deletions src/clogs/git.inko
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ class Output {
let @buffer: ByteArray

fn static new(child: sys.ChildProcess) -> Output {
let out = child.stdout := Option.None

Output(
stdout: BufferedReader.new(child.stdout),
stdout: BufferedReader.new(out.get),
child: child,
buffer: ByteArray.new,
)
Expand Down Expand Up @@ -153,13 +155,13 @@ class Repository {
fn run(command: String, arguments: Array[String]) -> Result[Output, Error] {
let cmd = sys.Command.new('git')

cmd.argument('-C')
cmd.argument(@path.to_string)
cmd.argument(command)
cmd.arguments(arguments)
cmd.stdin(sys.Stream.Null)
cmd.stderr(sys.Stream.Piped)
cmd.stdout(sys.Stream.Piped)
cmd.arguments.push('-C')
cmd.arguments.push(@path.to_string)
cmd.arguments.push(command)
cmd.arguments.append(arguments)
cmd.stdin = sys.Stream.Null
cmd.stderr = sys.Stream.Piped
cmd.stdout = sys.Stream.Piped

let child = try cmd.spawn.map_error(fn (e) { Error.Invalid(e) })
let status = try child.wait.map_error(fn (e) { Error.Invalid(e) })
Expand All @@ -168,7 +170,8 @@ class Repository {
Result.Ok(Output.new(child))
} else {
let out = ByteArray.new
let message = match child.stderr.read_all(out) {
let err = (child.stderr := Option.None).get
let message = match err.read_all(out) {
case Ok(_) -> {
# Trailing newlines may mess up error message formatting, so we get
# rid of them.
Expand Down
1 change: 0 additions & 1 deletion test/clogs/test_cli.inko
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import clogs.cli
import clogs.config (CONFIG_FILE, Config)
import clogs.git (Repository)
import clogs.helpers (read, with_directory, with_repository)
import clogs.version (Version)
import std.io (Write)
import std.optparse (Options)
import std.test (Tests)
Expand Down
1 change: 0 additions & 1 deletion test/clogs/test_config.inko
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import clogs.config (
Config, DEFAULT_CATEGORIES, DEFAULT_CHANGELOG, DEFAULT_URL, Error,
)
import clogs.helpers (with_file_path, write)
import std.env
import std.io
import std.test (Tests)

Expand Down

0 comments on commit 7f9a007

Please sign in to comment.
0