Skip to content

Commit

Permalink
fixed release script to make it compatible with zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
cjvirtucio87 committed Mar 30, 2022
1 parent c33f249 commit 46ff363
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

set -e

#!/bin/bash

set -e

### Script for creating and uploading releases.
###
### Usage:
Expand All @@ -18,14 +14,14 @@ set -e
### FULL_RELEASE:
### If set to anything, makes the release a full release.

ROOT_DIR="$(readlink --canonicalize --no-newline "$(dirname "$0")")"
ROOT_DIR="$(dirname "$0" | tr -d '\n')"
readonly ROOT_DIR

function cleanup {
>&2 echo "begin cleanup"
if [[ -d "${TEMP_DIR}" ]]; then
>&2 echo "purging TEMP_DIR [${TEMP_DIR}]"
rm --recursive --force "${TEMP_DIR}"
rm -rf "${TEMP_DIR}"
fi
>&2 echo "end cleanup"
}
Expand Down Expand Up @@ -71,7 +67,7 @@ function upload_release_asset {
function main {
echo "starting release"

TEMP_DIR="$(mktemp --directory)"
TEMP_DIR="$(mktemp -d)"
trap cleanup EXIT

local version
Expand All @@ -87,7 +83,7 @@ function main {
clconf --ignore-env --yaml "${release_yaml}" setv 'body' "bitwarden-cli-bash release, version ${version}"
clconf --ignore-env --yaml "${release_yaml}" setv 'draft' 'false'

if [[ ! -v FULL_RELEASE ]]; then
if [[ -z "${FULL_RELEASE}" ]]; then
clconf --ignore-env --yaml "${release_yaml}" setv 'prerelease' 'true'
fi

Expand Down Expand Up @@ -127,7 +123,7 @@ function main {
"${ROOT_DIR}/bwsh" \
"${asset_name}")"

if [[ -v DEBUG ]]; then
if [[ -n "${DEBUG}" ]]; then
>&2 clconf --yaml <(echo "${upload_release_asset_response}")
fi
echo "completed release"
Expand Down

0 comments on commit 46ff363

Please sign in to comment.