OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Prints the path to the most recently built image to stdout. | 7 # Prints the path to the most recently built image to stdout. |
8 | 8 |
9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
11 . "$(dirname "$0")/common.sh" | 11 . "$(dirname "$0")/common.sh" |
12 | 12 |
13 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images" | 13 DEFINE_string board "" "The name of the board to check for images." |
| 14 |
| 15 # Parse command line flags |
| 16 FLAGS "$@" || exit 1 |
| 17 eval set -- "${FLAGS_ARGV}" |
| 18 |
| 19 # Check on the board that they are trying to set up. |
| 20 if [ -z "$FLAGS_board" ] ; then |
| 21 echo "Error: --board required." |
| 22 exit 1 |
| 23 fi |
| 24 |
| 25 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" |
14 # Default to the most recent image | 26 # Default to the most recent image |
15 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" | 27 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" |
16 | 28 |
17 echo $DEFAULT_FROM | 29 echo $DEFAULT_FROM |
OLD | NEW |