Skip to content

Commit ac11227

Browse files
authored
Fix code link and other stuff (#66)
* Update Rust to 1.84.1 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fixes Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fix Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
1 parent ec99a19 commit ac11227

File tree

6 files changed

+53
-27
lines changed

6 files changed

+53
-27
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace.package]
22
edition = "2021"
33
authors = ["Oliver Tale-Yazdi <[email protected]>"]
4-
version = "3.4.3"
4+
version = "3.4.4"
55
repository = "https://github.com/ggwpez/substrate-weight-compare"
66
readme = "README.md"
77
keywords = [ "polkadot", "substrate", "blockchain" ]
@@ -18,7 +18,7 @@ members = [
1818
resolver = "2"
1919

2020
[workspace.dependencies]
21-
subweight-core = { version = "3.4.3", path = "core" }
21+
subweight-core = { version = "3.4.4", path = "core" }
2222

2323
clap = { version = "4.5.16", features = ["derive"] }
2424
env_logger = "0.11.5"

Justfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
default: fmt test
2+
3+
fmt:
4+
cargo +nightly-2024-09-11 fmt --all
5+
6+
test:
7+
cargo test --release --all-targets --all-features
8+
9+
dev:
10+
cargo r --release --bin subweight-web -- --endpoint 127.0.0.1 --repos polkadot-sdk --root repos --port 4000
11+
12+
publish:
13+
#!/usr/bin/env bash
14+
echo "Checking if crate can be published..."
15+
16+
VERSION=$(shell grep -E '^version = "[0-9.]+"' Cargo.toml | cut -d'"' -f2)
17+
TAG=v$(VERSION)
18+
echo "Publishing version '$(VERSION)' with tag '$(TAG)'"
19+
echo "- Publishing crate to crates.io..."
20+
echo " - Publishing core..."
21+
cargo publish -p subweight-core --allow-dirty -q
22+
echo " - Publishing cli..."
23+
cargo publish -p subweight --allow-dirty -q
24+
echo " - Publishing web..."
25+
cargo publish -p subweight-web --allow-dirty -q
26+
echo "- Please sign the tag..."
27+
git tag -s -a $(TAG) -m "Version $(VERSION)"
28+
echo "- Pushing tag to GitHub..."
29+
git push -f origin $(TAG)
30+
echo "Done!"

Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.80.0"
2+
channel = "1.84.1"
33
components = [ "rustfmt", "clippy" ]
44
profile = "minimal"

web/src/main.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,25 @@ async fn main() -> std::io::Result<()> {
107107
"Need at least one value to --repos",
108108
))
109109
}
110+
111+
if !cmd.root_path.exists() {
112+
return Err(std::io::Error::new(
113+
std::io::ErrorKind::Other,
114+
format!("Root path '{}' does not exist", cmd.root_path.display()),
115+
))
116+
}
117+
110118
for repo_name in cmd.repos {
111119
// TODO check that the folder exists
112120
let path = cmd.root_path.join(&repo_name);
121+
122+
if !path.exists() {
123+
return Err(std::io::Error::new(
124+
std::io::ErrorKind::Other,
125+
format!("Repo directory '{}' does not exist", path.display()),
126+
))
127+
}
128+
113129
let organization = git::get_origin_org(&path).map_err(|e| {
114130
std::io::Error::new(
115131
std::io::ErrorKind::Other,

0 commit comments

Comments
 (0)