diff --git a/README.md b/README.md index c6932f8..6325345 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,18 @@ # Installation +Automated system-wide installation: ``` curl -fsSL https://gitea.jde.nz/public/bb64/releases/download/latest/install.sh | bash ``` +## To download just the bb64 executable: + +``` +curl -fsSL -o bb64 https://gitea.jde.nz/public/bb64/releases/download/latest/bb64.amd64 && chmod a+x bb64 +``` + + # Use Bash Base64, written in C++. diff --git a/bb64.cpp b/bb64.cpp index c7b28d5..26af5d4 100644 --- a/bb64.cpp +++ b/bb64.cpp @@ -52,6 +52,7 @@ int update_bb64() { // determine path to this executable std::filesystem::path bb64_path = std::filesystem::canonical("/proc/self/exe"); + std::filesystem::path parent_path = bb64_path.parent_path(); // determine the architecture of the system std::string arch = get_arch(); @@ -60,7 +61,7 @@ int update_bb64() // download new version, preserve permissions and ownership std::string bash_script; - bash_script += "docker run --rm -v /usr/local/bin:/target"; + bash_script += "docker run --rm -v "+parent_path.string()+":/target"; bash_script += " gitea.jde.nz/public/debian-curl:latest"; bash_script += " sh -c \""; bash_script += " curl -fsSL " + url + " -o /target/bb64_temp &&"; diff --git a/version.h b/version.h index badf3cc..171c514 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -static const char *VERSION = "28"; +static const char *VERSION = "29";