| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 2 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE.md file. | 4 # BSD-style license that can be found in the LICENSE.md file. |
| 5 | 5 |
| 6 # Run internal/pkg/flash_sd_card/bin/flash_sd_card.dart on the Dart VM. | 6 # Run internal/pkg/flash_sd_card/bin/flash_sd_card.dart on the Dart VM. |
| 7 # This script assumes either the Fletch SDK's directory structure or | 7 # This script assumes either the Dartino SDK's directory structure or |
| 8 # a Fletch GitHub repository checkout. | 8 # a Dartino GitHub repository checkout. |
| 9 | 9 |
| 10 function follow_links() { | 10 function follow_links() { |
| 11 file="$1" | 11 file="$1" |
| 12 while [ -h "$file" ]; do | 12 while [ -h "$file" ]; do |
| 13 # On Mac OS, readlink -f doesn't work. | 13 # On Mac OS, readlink -f doesn't work. |
| 14 file="$(readlink "$file")" | 14 file="$(readlink "$file")" |
| 15 done | 15 done |
| 16 echo "$file" | 16 echo "$file" |
| 17 } | 17 } |
| 18 | 18 |
| 19 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. | 19 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. |
| 20 PROG_NAME="$(follow_links "$BASH_SOURCE")" | 20 PROG_NAME="$(follow_links "$BASH_SOURCE")" |
| 21 | 21 |
| 22 source $(dirname $PROG_NAME)/.common.shlib | 22 source $(dirname $PROG_NAME)/.common.shlib |
| 23 | 23 |
| 24 echo "This program requires superuser to run." | 24 echo "This program requires superuser to run." |
| 25 | 25 |
| 26 exec sudo "$DART_VM" -Dfletch-vm="$FLETCH_VM" "$DART_FILE" \ | 26 exec sudo "$DART_VM" -Ddartino-vm="$DARTINO_VM" "$DART_FILE" \ |
| 27 --configure-network-only "$@" | 27 --configure-network-only "$@" |
| OLD | NEW |