blob: f1234bb7788e7d9f8b9aab53c9b908518a9ccd4d [file] [log] [blame]
#!/bin/sh
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# manifest_add_dest_prefix.sh prefix input-file output-file
#
# Split manifest lines, adding the given prefix to the dest path.
set -e
readonly prefix="$1"
readonly input="$2"
readonly output="$3"
while read line
do
if [ -n "${line}" ]; then
left="${line%%=*}"
right="${line#*=}"
printf "%s%s=%s%s\n" "$prefix" "$left" "$right"
fi
done < "${input}" > "${output}"