Skip to content

Commit

Permalink
Clean up shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickpeterse committed Oct 30, 2023
1 parent 2d0ccca commit 1655caa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
9 changes: 3 additions & 6 deletions scripts/aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ aur_clone="/tmp/aur-${name}"

if [[ "${name}" = '' ]]
then
echo 'The package name must be specified as the first argument'
exit 1
error 'The package name must be specified as the first argument'
fi

if [[ "${version}" = '' ]]
then
echo 'The version must be specified as the second argument'
exit 1
error 'The version must be specified as the second argument'
fi

if [[ "${ssh_key}" = '' ]]
then
echo 'The SSH private key must be specified as the third argument'
exit 1
error 'The SSH private key must be specified as the third argument'
fi

if [[ -v CI ]]
Expand Down
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash

set -e
source ./scripts/setup.sh

name="${1}"

if [[ "${name}" = '' ]]
then
echo 'The package name must be specified as the first argument'
exit 1
error 'The package name must be specified as the first argument'
fi

cd "${name}"
Expand Down
6 changes: 2 additions & 4 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ version="${2}"

if [[ "${name}" = '' ]]
then
echo 'The package name must be specified as the first argument'
exit 1
error 'The package name must be specified as the first argument'
fi

if [[ "${version}" = '' ]]
then
echo 'The version must be specified as the second argument'
exit 1
error 'The version must be specified as the second argument'
fi

cd "${name}"
Expand Down

0 comments on commit 1655caa

Please sign in to comment.