3 Commits

Author SHA1 Message Date
b1562e7d33 Update program version and fix git command output handling
Bump the program version from 2.2.6 to 2.2.7. Remove unnecessary [-q] flag from the [git ls-remote] command to ensure proper output handling and improve compatibility.
2025-04-23 20:20:26 +02:00
e293c02fbb Make this repo public :) 2025-01-09 12:26:13 +02:00
e0ddbff0d1 Add bash logo, written by, linted by to README. 2024-03-20 16:26:36 +02:00
2 changed files with 12 additions and 11 deletions

View File

@@ -1,16 +1,17 @@
# Octozipo <h2><img align="middle" src="https://raw.githubusercontent.com/odb/official-bash-logo/master/assets/Logos/Icons/PNG/64x64.png" >
Octozipo - Convert Zip package to a repository.
</h2>
Written by Llewellyn van der Merwe (@llewellynvdm)
Convert Zip packages to repositories and if they exist update and tag them. Convert Zip packages to repositories and if they exist update and tag them.
Linted by [#ShellCheck](https://github.com/koalaman/shellcheck)
## Install ## Install
## Get needed access token
Get a token from [https://git.vdm.dev/user/settings/applications](https://git.vdm.dev/user/settings/applications)
```shell ```shell
$ export SETUP_TOKEN="xxxxxxxxxxtokenxxxxxxxxxxxxxxxxxxxxxxxx" $ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octozipo/raw/src/octozipo" -o /usr/local/bin/octozipo
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octozipo/raw/src/octozipo?access_token=${SETUP_TOKEN}" -o /usr/local/bin/octozipo
$ sudo chmod +x /usr/local/bin/octozipo $ sudo chmod +x /usr/local/bin/octozipo
``` ```
- Global **environment** file can be set at: `/home/$USER/.config/octozipo/.env` - Global **environment** file can be set at: `/home/$USER/.config/octozipo/.env`

View File

@@ -3,7 +3,7 @@
# Program name # Program name
PROGRAM_NAME="Octozipo" PROGRAM_NAME="Octozipo"
PROGRAM_CODE="octozipo" PROGRAM_CODE="octozipo"
PROGRAM_VERSION="2.2.6" PROGRAM_VERSION="2.2.7"
PROGRAM_V="2.2" PROGRAM_V="2.2"
# PROGRAM_URL="https://git.vdm.dev/octoleo/${PROGRAM_CODE}" # PROGRAM_URL="https://git.vdm.dev/octoleo/${PROGRAM_CODE}"
@@ -84,7 +84,7 @@ main() {
# get the package details # get the package details
getPackageDetails "${zip_name}" "${folder_name}" getPackageDetails "${zip_name}" "${folder_name}"
# check if the repo exist on our system # check if the repo exist on our system
if git ls-remote --exit-code --heads "git@${VDM_GIT_URL}:${VDM_ORG}/${VDM_REPO_NAME}.git" "${VDM_REPO_BRANCH}" -q >/dev/null 2>&1; then if git ls-remote --exit-code --heads "git@${VDM_GIT_URL}:${VDM_ORG}/${VDM_REPO_NAME}.git" "${VDM_REPO_BRANCH}" >/dev/null 2>&1; then
# check if repo is locally found # check if repo is locally found
cd "${VDM_PATH_REPO}" >/dev/null 2>&1 || { cd "${VDM_PATH_REPO}" >/dev/null 2>&1 || {
git clone "git@${VDM_GIT_URL}:${VDM_ORG}/${VDM_REPO_NAME}.git" \ git clone "git@${VDM_GIT_URL}:${VDM_ORG}/${VDM_REPO_NAME}.git" \
@@ -806,7 +806,7 @@ function getVersionNumberByFile() {
function rightStrip() { function rightStrip() {
# Usage: rightStrip "string" "pattern" # Usage: rightStrip "string" "pattern"
printf '%s\n' "${1%%$2}" printf '%s\n' "${1%%"$2"}"
} }
# leftStrip - Removes the specified pattern from the start of a string # leftStrip - Removes the specified pattern from the start of a string
@@ -824,7 +824,7 @@ function rightStrip() {
# The modified string with the pattern removed from the start # The modified string with the pattern removed from the start
function leftStrip() { function leftStrip() {
# Usage: leftStrip "string" "pattern" # Usage: leftStrip "string" "pattern"
printf '%s\n' "${1##$2}" printf '%s\n' "${1##"$2"}"
} }
# This function unzips the package located in the `VDM_ZIP_DIR` directory to the specified folder. # This function unzips the package located in the `VDM_ZIP_DIR` directory to the specified folder.