Skip to content

Commit 3e01563

Browse files
authored
Merge pull request #488 from github/juruen/fix-macos
fix GNUisms and macOS errors
2 parents 1720736 + 9bc7dfa commit 3e01563

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

share/github-backup-utils/ghe-restore-mysql-audit-log

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ has_schema_changed(){
174174

175175
# Add DROP TABLE to a table schema dump
176176
add_drop_table(){
177-
# shellcheck disable=SC2016
178-
sed '/40101 SET @saved_cs_client/i DROP TABLE IF EXISTS `audit_entries`;'
177+
awk '/40101 SET @saved_cs_client/{print "DROP TABLE IF EXISTS `audit_entries`;"}1'
179178
}
180179

181180
# Restore the audit_entries table schema if it has changed
@@ -185,7 +184,7 @@ restore_schema(){
185184
fi
186185

187186
gunzip -c "${snapshot_dir}/schema.gz" | add_drop_table | gzip > "${snapshot_dir}/schema.new.gz" 2>&3
188-
zcat "${snapshot_dir}/schema.new.gz" 1>&3
187+
zcat <"${snapshot_dir}/schema.new.gz" 1>&3
189188

190189
restore_dump schema.new
191190
}

0 commit comments

Comments
 (0)