Skip to content

Commit

Permalink
Fix code link and other stuff (#66)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
ggwpez authored Feb 24, 2025
1 parent ec99a19 commit ac11227
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 27 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace.package]
edition = "2021"
authors = ["Oliver Tale-Yazdi <[email protected]>"]
version = "3.4.3"
version = "3.4.4"
repository = "https://github.com/ggwpez/substrate-weight-compare"
readme = "README.md"
keywords = [ "polkadot", "substrate", "blockchain" ]
Expand All @@ -18,7 +18,7 @@ members = [
resolver = "2"

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

clap = { version = "4.5.16", features = ["derive"] }
env_logger = "0.11.5"
Expand Down
30 changes: 30 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
default: fmt test

fmt:
cargo +nightly-2024-09-11 fmt --all

test:
cargo test --release --all-targets --all-features

dev:
cargo r --release --bin subweight-web -- --endpoint 127.0.0.1 --repos polkadot-sdk --root repos --port 4000

publish:
#!/usr/bin/env bash
echo "Checking if crate can be published..."
VERSION=$(shell grep -E '^version = "[0-9.]+"' Cargo.toml | cut -d'"' -f2)
TAG=v$(VERSION)
echo "Publishing version '$(VERSION)' with tag '$(TAG)'"
echo "- Publishing crate to crates.io..."
echo " - Publishing core..."
cargo publish -p subweight-core --allow-dirty -q
echo " - Publishing cli..."
cargo publish -p subweight --allow-dirty -q
echo " - Publishing web..."
cargo publish -p subweight-web --allow-dirty -q
echo "- Please sign the tag..."
git tag -s -a $(TAG) -m "Version $(VERSION)"
echo "- Pushing tag to GitHub..."
git push -f origin $(TAG)
echo "Done!"
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.80.0"
channel = "1.84.1"
components = [ "rustfmt", "clippy" ]
profile = "minimal"
16 changes: 16 additions & 0 deletions web/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,25 @@ async fn main() -> std::io::Result<()> {
"Need at least one value to --repos",
))
}

if !cmd.root_path.exists() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("Root path '{}' does not exist", cmd.root_path.display()),
))
}

for repo_name in cmd.repos {
// TODO check that the folder exists
let path = cmd.root_path.join(&repo_name);

if !path.exists() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("Repo directory '{}' does not exist", path.display()),
))
}

let organization = git::get_origin_org(&path).map_err(|e| {
std::io::Error::new(
std::io::ErrorKind::Other,
Expand Down

0 comments on commit ac11227

Please sign in to comment.