summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-12-31 18:32:03 +0100
committerSanto Cariotti <santo@dcariotti.me>2024-12-31 18:32:03 +0100
commit861400563abee500682bea89161eabfcb86a3e60 (patch)
tree0b1376069a5c9c7b59ec5cf07b6f172d5eda74c4
parent54754e539332d569ce72ee47528cbb43ad24a47d (diff)
Read path automatically
-rwxr-xr-xscripts/01-create-bucket.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/01-create-bucket.sh b/scripts/01-create-bucket.sh
index fb853c9..364e098 100755
--- a/scripts/01-create-bucket.sh
+++ b/scripts/01-create-bucket.sh
@@ -1,6 +1,14 @@
#!/bin/sh
-read -p "Enter 'order_products.csv' path: " path
+path=$(find . -name 'order_products.csv' -print -quit)
+
+if [ -z "$path" ]; then
+ read -p "Enter 'order_products.csv' path: " path
+ if [ -z "$path" ] || [ ! -e "$path" ]; then
+ echo ">>>> Path not found..."
+ exit 1
+ fi
+fi
gcloud storage buckets create gs://$BUCKET_NAME --location=eu
gcloud storage buckets add-iam-policy-binding gs://${BUCKET_NAME} \