feat: Update 4 files
This commit is contained in:
BIN
dshash/dshash
BIN
dshash/dshash
Binary file not shown.
@@ -4,8 +4,11 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#define DSHASH_VERSION "__VERSION__"
|
||||||
|
|
||||||
void printUsage(const std::string& program) {
|
void printUsage(const std::string& program) {
|
||||||
std::cerr << "Usage: " << program << " [-v] <file_or_directory_path>\n";
|
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";
|
std::cerr << " -v Verbose mode (list files as they are processed)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,6 +18,12 @@ int main(int argc, char* argv[]) {
|
|||||||
return 1;
|
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;
|
bool verbose = false;
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
||||||
|
BIN
dshash/main.o
BIN
dshash/main.o
Binary file not shown.
@@ -6,6 +6,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
PROJECT="$(basename "${SCRIPT_DIR}")"
|
PROJECT="$(basename "${SCRIPT_DIR}")"
|
||||||
OUTPUT="${SCRIPT_DIR}/output"
|
OUTPUT="${SCRIPT_DIR}/output"
|
||||||
|
VERSION=$(date -u +"%Y.%m%d.%H%M")
|
||||||
|
|
||||||
function heading() {
|
function heading() {
|
||||||
echo "--------------------------------"
|
echo "--------------------------------"
|
||||||
@@ -30,10 +31,16 @@ mkdir -p "${OUTPUT}"
|
|||||||
#--------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------
|
||||||
heading "Building ${PROJECT}"
|
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
|
# build release version
|
||||||
"${SCRIPT_DIR}/build.sh"
|
"${SCRIPT_DIR}/build.sh"
|
||||||
[ -f "${OUTPUT}/${PROJECT}" ] || die "Build failed."
|
[ -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
|
# install getpkg
|
||||||
GETPKG_PATH="${HOME}/.local/bin/getpkg/getpkg"
|
GETPKG_PATH="${HOME}/.local/bin/getpkg/getpkg"
|
||||||
if [ ! -f "${GETPKG_PATH}" ]; then
|
if [ ! -f "${GETPKG_PATH}" ]; then
|
||||||
|
Reference in New Issue
Block a user