Skip to content

Commit 7d7f31e

Browse files
milispclaude
andcommitted
feat: add version flag and release script for codex_export_bindings
Add -v flag support to display binary version and create release script for distributing codex_export_bindings to cargo bin directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
1 parent cd0b693 commit 7d7f31e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

codex-bindings/src/bin/codex_export_bindings.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ use std::path::PathBuf;
44
fn main() {
55
let args: Vec<String> = env::args().collect();
66

7+
if args.len() > 1 && args[1] == "-v" {
8+
println!("{}", env!("CARGO_PKG_VERSION"));
9+
return;
10+
}
11+
712
let out = if args.len() > 1 {
813
Some(PathBuf::from(&args[1]))
914
} else {

scripts/release_codex_bindings.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
VERSION=$(grep -A 1 '\[workspace.package\]' Cargo.toml | grep version | sed 's/.*"\([^"]*\)".*/\1/')
5+
cargo build -p codex-bindings --bin codex_export_bindings --release
6+
7+
BINARY_PATH="target/release/codex_export_bindings"
8+
CARGO_BIN_DIR="${CARGO_HOME:-$HOME/.cargo}/bin"
9+
10+
if [ -f "$BINARY_PATH" ]; then
11+
mkdir -p "$CARGO_BIN_DIR"
12+
cp "$BINARY_PATH" "$CARGO_BIN_DIR/"
13+
chmod +x "$CARGO_BIN_DIR/codex_export_bindings"
14+
echo "Released codex_export_bindings v$VERSION to $CARGO_BIN_DIR"
15+
else
16+
echo "Error: Binary not found at $BINARY_PATH"
17+
exit 1
18+
fi

0 commit comments

Comments
 (0)