diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..96c3ac1 --- /dev/null +++ b/.vscode/settings.json @@ -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 + } +} \ No newline at end of file diff --git a/src/crates_README.md b/src/crates_README.md index ce06152..5215eef 100644 --- a/src/crates_README.md +++ b/src/crates_README.md @@ -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)!) diff --git a/src/template/Cargo.toml b/src/template/Cargo.toml index 0daf532..cc56e47 100644 --- a/src/template/Cargo.toml +++ b/src/template/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "{?TOOLCHAIN.EDITION}" [dependencies] -{?CRATES} \ No newline at end of file +{?CRATES} diff --git a/src/template/build.sh b/src/template/build.sh index c55ec38..dbfc07a 100644 --- a/src/template/build.sh +++ b/src/template/build.sh @@ -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 \ No newline at end of file +fi diff --git a/src/template/rust-toolchain.toml b/src/template/rust-toolchain.toml index 20eaaef..977dff9 100644 --- a/src/template/rust-toolchain.toml +++ b/src/template/rust-toolchain.toml @@ -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} ] \ No newline at end of file