Skip to content

Commit cbe3132

Browse files
committed
add support for OSX
when substituting "in place" with the -i flag using the sed in Mac OS X, you are required to supply an extension for backing up the file.
1 parent 9205984 commit cbe3132

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

export.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
_os="`uname`"
12
_now=$(date +"%m_%d_%Y")
23
_file="wp-data/data_$_now.sql"
34
docker-compose exec db sh -c 'exec mysqldump "$MYSQL_DATABASE" -uroot -p"$MYSQL_ROOT_PASSWORD"' > $_file
4-
sed -i 1,1d $_file # Removes the password warning from the file
5+
if [[ $_os == "Darwin"* ]] ; then
6+
sed -i '.bak' 1,1d $_file
7+
else
8+
sed -i 1,1d $_file # Removes the password warning from the file
9+
fi

0 commit comments

Comments
 (0)