Skip to content

Commit 0135d49

Browse files
committed
improving script to be macOS friendly
1 parent 414a1e2 commit 0135d49

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

azure-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
FILE=".env"
66
if [[ -f $FILE ]]; then
77
echo "Loading from $FILE"
8-
eval $(egrep "^[^#;]" .env | xargs -d'\n' -n1 | sed 's/^/export /')
8+
eval $(egrep "^[^#;]" $FILE | xargs -0 -n1 | sed 's/^/export /')
99
else
1010
cat << EOF > .env
1111
resourceGroup=""

database/azure-create-sql-db.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
FILE="../.env"
66
if [[ -f $FILE ]]; then
77
echo "Loading from $FILE"
8-
export $(egrep "^[^#;]" $FILE | xargs -n1)
8+
eval $(egrep "^[^#;]" $FILE | xargs -0 -n1 | sed 's/^/export /')
99
else
1010
echo "Enviroment file not detected."
1111
echo "Please make sure there is a .env file in the sample root folder and run the script again."

database/declarative-deploy/azure-deploy-sql-db.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ set -euo pipefail
55
FILE="../.env"
66
if [[ -f $FILE ]]; then
77
echo "Loading from $FILE"
8-
set -o allexport
9-
source $FILE
10-
set +o allexport
8+
eval $(egrep "^[^#;]" $FILE | xargs -0 -n1 | sed 's/^/export /')
119
else
1210
echo "Enviroment file not detected."
1311
echo "Please make sure there is a .env file in the 'database' folder and run the script again."
@@ -18,7 +16,6 @@ echo "Building .dacpac..."
1816
dotnet build /p:NetCoreBuild=true todo_v5
1917

2018
echo "Publishing .dacpac..."
21-
echo "$ConnectionString"
2219
sqlpackage /Action:Publish /SourceFile:./todo_v5/bin/Debug/todo_v5.dacpac /TargetConnectionString:"$ConnectionString"
2320

2421
echo "Done."

test/azure-deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -euo pipefail
77
FILE="../.env"
88
if [[ -f $FILE ]]; then
99
echo "Loading from $FILE"
10-
export $(egrep "^[^#;]" $FILE | xargs -n1)
10+
eval $(egrep "^[^#;]" $FILE | xargs -0 -n1 | sed 's/^/export /')
1111
else
1212
echo "Enviroment file not detected."
1313
echo "Please make sure there is a .env file in the sample root folder and run the script again."
@@ -18,7 +18,7 @@ fi
1818
FILE=".env"
1919
if [[ -f $FILE ]]; then
2020
echo "loading from .env" | tee -a log.txt
21-
export $(egrep "^[^#;]" $FILE | xargs -n1)
21+
eval $(egrep "^[^#;]" $FILE | xargs -0 -n1 | sed 's/^/export /')
2222
else
2323
cat << EOF > .env
2424
HOST="https://jsonplaceholder.typicode.com"

0 commit comments

Comments
 (0)