Skip to content

Commit

Permalink
better argument checking
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Nov 21, 2024
1 parent cd87fca commit fe1570d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -433,17 +433,12 @@
text = ''
set -euo pipefail
if [[ -z "''${1-}" ]]; then
if [[ $# -lt 2 ]]; then
echo "Usage: get-logs [start | download] namespaceFile"
exit 1
fi
case $1 in
start)
if [[ -z "''${2-}" ]]; then
echo "Please add the path to the namespace file."
echo "Usage: get-logs start namespaceFile"
exit 1
fi
while ! [[ -s "$2" ]]; do
sleep 1
done
Expand All @@ -453,11 +448,6 @@
kubectl apply -f ./workspace/log-collector.yaml 1>/dev/null 2>/dev/null
;;
download)
if [[ -z "''${2-}" ]]; then
echo "Please add the path to the namespace file."
echo "Usage: get-logs download namespaceFile"
exit 1
fi
namespace="$(head -n1 "$2")"
pod="$(kubectl get pods -o name -n "$namespace" | grep log-collector | cut -c 5-)"
mkdir -p ./workspace/logs
Expand Down

0 comments on commit fe1570d

Please sign in to comment.