diff --git a/Cargo.toml b/Cargo.toml index e5f65c4..c5ef957 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bak9" -version = "0.1.2" +version = "0.2.0" edition = "2021" description = "Creates a backup .bak copy of a file" authors = ["Asmov LLC "] @@ -9,6 +9,10 @@ license = "GPL-3.0-or-later" keywords = ["backup", "copy"] categories = ["command-line-utilities", "filesystem"] +[[bin]] +name = "bak" +path = "src/main.rs" + [dependencies] clap = { version = "4", features = ["derive"] } colored = "2" diff --git a/tools/common.lib.bash b/tools/common.lib.bash index 4c42153..723a96a 100644 --- a/tools/common.lib.bash +++ b/tools/common.lib.bash @@ -14,5 +14,6 @@ RELEASE_TARGETS=( "${TARGET_WINDOWS_X86_64}" ) -CARGO_NAME="$(grep '^name' "${PROJECT_DIR}/Cargo.toml" | cut -d '"' -f 2)" +CARGO_NAME="$(grep -m1 '^name' "${PROJECT_DIR}/Cargo.toml" | cut -d '"' -f 2)" CARGO_VERSION="$(grep '^version' "${PROJECT_DIR}/Cargo.toml" | cut -d '"' -f 2)" +CARGO_BIN_NAME="$(sed -n '/\[\[bin\]\]/,$p' "${PROJECT_DIR}/Cargo.toml" | grep '^name' | cut -d '"' -f 2)" diff --git a/tools/package-tarball.bash b/tools/package-tarball.bash index ae5e4c4..8c25a59 100755 --- a/tools/package-tarball.bash +++ b/tools/package-tarball.bash @@ -26,9 +26,9 @@ for target in "${RELEASE_TARGETS[@]}"; do rsync -a "${TARBALL_TEMPLATE_DIR}/" "${package_dir}" if [[ "$target" != *"windows"* ]]; then - cp "${PROJECT_DIR}/target/${target}/release/${CARGO_NAME}" "${package_dir}" + cp "${PROJECT_DIR}/target/${target}/release/${CARGO_BIN_NAME}" "${package_dir}" else - cp "${PROJECT_DIR}/target/${target}/release/${CARGO_NAME}.exe" "${package_dir}" + cp "${PROJECT_DIR}/target/${target}/release/${CARGO_BIN_NAME}.exe" "${package_dir}" fi cd "${package_dir}/.."