summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/libvpx/copy_obj.sh
blob: a79f52502b6c782eff1929f1f2edb4484f373e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash -e
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This script is used to copy a file from several possible locations.
#
# Arguments:
#
# -d - Destination.
# -s - Source file path.
#

while getopts "d:s:" flag; do
  if [ "$flag" = "d" ]; then
    dest=$OPTARG
  elif [ "$flag" = "s" ]; then
    srcs="$OPTARG $srcs"
  fi
done

for f in $srcs; do
  if [ -a $f ]; then
    src=$f
    break
  fi
done

if [ -z "$src" ]; then
  echo "Unable to locate file."
  false
  exit
fi

cp "$src" "$dest"