feat: Update 4 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 20s
Build-Test-Publish / build (linux/arm64) (push) Successful in 26s

This commit is contained in:
Your Name
2025-09-02 20:31:24 +12:00
parent 54b3b09a88
commit dc717b7064
4 changed files with 16 additions and 0 deletions

Binary file not shown.

View File

@@ -4,8 +4,11 @@
#include <vector>
#include <string>
#define DSHASH_VERSION "__VERSION__"
void printUsage(const std::string& program) {
std::cerr << "Usage: " << program << " [-v] <file_or_directory_path>\n";
std::cerr << " " << program << " version\n";
std::cerr << " -v Verbose mode (list files as they are processed)\n";
}
@@ -15,6 +18,12 @@ int main(int argc, char* argv[]) {
return 1;
}
// Check for version command
if (argc == 2 && std::string(argv[1]) == "version") {
std::cout << DSHASH_VERSION << std::endl;
return 0;
}
bool verbose = false;
std::string path;

Binary file not shown.

View File

@@ -6,6 +6,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ARCH=$(uname -m)
PROJECT="$(basename "${SCRIPT_DIR}")"
OUTPUT="${SCRIPT_DIR}/output"
VERSION=$(date -u +"%Y.%m%d.%H%M")
function heading() {
echo "--------------------------------"
@@ -30,10 +31,16 @@ mkdir -p "${OUTPUT}"
#--------------------------------------------------------------------------------
heading "Building ${PROJECT}"
# Replace __VERSION__ in the source file before building
sed -i "s|__VERSION__|${VERSION}|g" "${SCRIPT_DIR}/dshash/main.cpp"
# build release version
"${SCRIPT_DIR}/build.sh"
[ -f "${OUTPUT}/${PROJECT}" ] || die "Build failed."
# Restore the placeholder for future builds
sed -i "s|${VERSION}|__VERSION__|g" "${SCRIPT_DIR}/dshash/main.cpp"
# install getpkg
GETPKG_PATH="${HOME}/.local/bin/getpkg/getpkg"
if [ ! -f "${GETPKG_PATH}" ]; then