#!/bin/bash # Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: AGPL-3.0 set -e fix=false while [[ "${@}" != "" ]] do arg=${1} shift case ${arg} in --help) cat <&2 "Unrecognized argument '${arg}'. Try $0 --help" exit 2 ;; esac done fixer() { want="${want}" perl -pi~ - "${1}" <<'EOF' BEGIN { undef $/ } s{^((\#\!.*?\n|\n*---\n.*?\n\.\.\.\n|<\?xml.*?>\n)\n?)?}{${2}$ENV{want}\n\n}ms EOF } IFS=$'\n' read -a ignores -r -d $'\000' <.licenseignore || true result=0 coproc git ls-files -z ${@}