Add 1 and update 2 files
This commit is contained in:
18
publish.sh
18
publish.sh
@@ -17,22 +17,28 @@ function heading() {
|
||||
#--------------------------------------------------------------------------------
|
||||
heading "Publishing ${PROJECT} as tool to ${PROJECT}:${ARCH} (on getpkg.xyz)"
|
||||
|
||||
# Generate version timestamp
|
||||
VERSION=$(date -u +"%Y.%m%d.%H%M")
|
||||
|
||||
# Update version in the main sos script
|
||||
echo "Updating version in main ${PROJECT} script to ${VERSION}..."
|
||||
sed -i "s/^VERSION=\".*\"/VERSION=\"${VERSION}\"/" "${SCRIPT_DIR}/${PROJECT}"
|
||||
|
||||
# Copy the tool to the tool directory
|
||||
TOOLDIR="${SCRIPT_DIR}/tool"
|
||||
mkdir -p "${TOOLDIR}"
|
||||
cp "${SCRIPT_DIR}/${PROJECT}" "${TOOLDIR}/${PROJECT}"
|
||||
|
||||
# Replace version placeholder with actual timestamp
|
||||
VERSION=$(date -u +"%Y.%m%d.%H%M")
|
||||
sed -i "s/__VERSION_PLACEHOLDER__/${VERSION}/g" "${TOOLDIR}/${PROJECT}"
|
||||
|
||||
# Print the version of the tool
|
||||
echo "Version of the tool:"
|
||||
"${TOOLDIR}/${PROJECT}" version
|
||||
|
||||
|
||||
# Use getpkg to publish the tool
|
||||
GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg"
|
||||
# Use getpkg to publish the tool - check standard location first
|
||||
GETPKG="${HOME}/.local/bin/getpkg/getpkg"
|
||||
if [ ! -f "$GETPKG" ]; then
|
||||
GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg"
|
||||
fi
|
||||
if [ ! -f "$GETPKG" ]; then
|
||||
GETPKG="${SCRIPT_DIR}/../getpkg/getpkg"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user