Skip to content

Commit

Permalink
Added some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AverseABFun committed Dec 26, 2024
1 parent e19df79 commit 4889912
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[toml]": {
"editor.formatOnSave": false
// ^^ because of src/template/rust-toolchain.toml and the toml formatter not playing well with the weird template things I added
}
}
2 changes: 2 additions & 0 deletions src/crates_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ replace-with = 'local-registry'
[source.local-registry]
local-registry = '{?TOOLCHAIN.CRATES_DIR}' # double-check this path is correct, especially if you are creating the package on a different machine than the machine you are creating the package for
```

(psst- if you know how to install crate files to the registry manually, make an issue or PR on [rust-pkg-gen](https://github.com/AverseABFun/rust-pkg-gen)!)
2 changes: 1 addition & 1 deletion src/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "{?TOOLCHAIN.EDITION}"

[dependencies]
{?CRATES}
{?CRATES}
10 changes: 5 additions & 5 deletions src/template/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
CI=1
cd "$(dirname "$0")"
# shellcheck shell=bash
cd "$(dirname "$0")" || exit
cargo generate-lockfile --verbose
"$CARGO_BIN_FILE_CARGO_LOCAL_REGISTRY" local-registry --sync Cargo.lock crates > /dev/null 2>&1
# ^^^ is super jank, but it expects that the first argument is the provided subcommand of cargo.
"$CARGO_BIN_FILE_CARGO_LOCAL_REGISTRY" local-registry --sync Cargo.lock crates >/dev/null 2>&1
# ^^^ is super jank, but it expects that the first argument is local-registry and acts strangely otherwise

mv crates/* .
if [[ "$1" != "save" ]]; then
rm Cargo.lock Cargo.toml rust-toolchain.toml src/main.rs .cargo/config.toml build.sh
rm -d src .cargo crates
fi
fi
2 changes: 1 addition & 1 deletion src/template/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
[toolchain] # to be honest, probably only targets is required(can someone confirm?), but i'm not taking chances
channel = "{?TOOLCHAIN.CHANNEL}"
components = [ {?TOOLCHAIN.COMPONENTS} ]
targets = [ {?TOOLCHAIN.TARGETS} ]

0 comments on commit 4889912

Please sign in to comment.