Skip to content

Commit

Permalink
add script and increment version
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Sep 29, 2023
1 parent 1cf64cd commit 4caadad
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 49 deletions.
24 changes: 12 additions & 12 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "rookiepy"
version = "0.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "rookiepy"
crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.19.0"
[package]
name = "rookiepy"
version = "0.1.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "rookiepy"
crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.19.0"
rookie = { path = "../../rookie-rs" }
74 changes: 37 additions & 37 deletions rookie-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[package]
name = "rookie"
version = "0.1.2"
edition = "2021"
description = "Load cookie from your web browsers"
license-file = "MIT-LICENSE.txt"
homepage = "https://crates.io/crates/rookie"
documentation = "https://docs.rs/rookie/"
repository = "https://github.com/thewh1teagle/rookie"
readme = "README.md"
keywords = ["windows", "cookies", "rust", "web"]

[lib]
name = "rookie"
path = "src/lib.rs"

[[bin]]
name = "main"
path = "bin/main.rs"

[dependencies]
aes-gcm = "0.10.3"
rusqlite = { version = "0.29.0", features = ["bundled"] }
rust-ini = "0.19.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
url = "2.4.1"

[target.'cfg(unix)'.dependencies]
bcrypt-pbkdf = "0.10.0"

[target.'cfg(target_os = "macos")'.dependencies]
bcrypt-pbkdf = "0.10.0"

[target.'cfg(windows)'.dependencies]
windows = { version = "0.51.1", features = ["Win32_Security_Cryptography", "Win32_Foundation"] }
base64 = "0.21.4"
[package]
name = "rookie"
version = "0.1.3"
edition = "2021"
description = "Load cookie from your web browsers"
license-file = "MIT-LICENSE.txt"
homepage = "https://crates.io/crates/rookie"
documentation = "https://docs.rs/rookie/"
repository = "https://github.com/thewh1teagle/rookie"
readme = "README.md"
keywords = ["windows", "cookies", "rust", "web"]

[lib]
name = "rookie"
path = "src/lib.rs"

[[bin]]
name = "main"
path = "bin/main.rs"

[dependencies]
aes-gcm = "0.10.3"
rusqlite = { version = "0.29.0", features = ["bundled"] }
rust-ini = "0.19.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
url = "2.4.1"

[target.'cfg(unix)'.dependencies]
bcrypt-pbkdf = "0.10.0"

[target.'cfg(target_os = "macos")'.dependencies]
bcrypt-pbkdf = "0.10.0"

[target.'cfg(windows)'.dependencies]
windows = { version = "0.51.1", features = ["Win32_Security_Cryptography", "Win32_Foundation"] }
base64 = "0.21.4"
23 changes: 23 additions & 0 deletions scripts/publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pathlib import Path
import re


def increment_ver(version):
version = version.split('.')
version[2] = str(int(version[2]) + 1)
return '.'.join(version)

cur = Path(__file__).parent
cargo_paths = [cur / '../rookie-rs', cur / '../bindings/python']


for path in cargo_paths:
toml = path / 'cargo.toml'
content = toml.open('r').read()
pattern = 'version = "(.+)"[\S\s]edition = ".+"'
ver = re.search(pattern, content)
if ver:
new_ver = increment_ver(ver.group(1))
new_content = re.sub(pattern, f'version = "{new_ver}"\nedition = "2021"', content)
with toml.open('w') as f:
f.write(new_content)

0 comments on commit 4caadad

Please sign in to comment.