Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: mount_gpt_image.sh

Issue 2951007: replace test -n ... && clauses with proper ifs (Closed) Base URL: ssh://git@gitrw.chromium.org:9222//crosutils.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mount_gpt_image.sh
diff --git a/mount_gpt_image.sh b/mount_gpt_image.sh
index 3fa7b11919d28fb330cf3a9a6b757a9c06057089..247428047c9a9a4d01c1f80343bffcb022898b46 100755
--- a/mount_gpt_image.sh
+++ b/mount_gpt_image.sh
@@ -50,7 +50,9 @@ function unmount_image() {
fix_broken_symlinks "${FLAGS_rootfs_mountpt}"
sudo umount "${FLAGS_rootfs_mountpt}/usr/local"
sudo umount "${FLAGS_rootfs_mountpt}/var"
- test -n "${FLAGS_esp_mountpt}" && sudo umount -d "${FLAGS_esp_mountpt}"
+ if [[ -n "${FLAGS_esp_mountpt}" ]]; then
+ sudo umount -d "${FLAGS_esp_mountpt}"
+ fi
sudo umount -d "${FLAGS_stateful_mountpt}"
sudo umount -d "${FLAGS_rootfs_mountpt}"
set -e
@@ -59,8 +61,9 @@ function unmount_image() {
function get_usb_partitions() {
sudo mount "${FLAGS_from}3" "${FLAGS_rootfs_mountpt}"
sudo mount "${FLAGS_from}1" "${FLAGS_stateful_mountpt}"
- test -n "${FLAGS_esp_mountpt}" && \
+ if [[ -n "${FLAGS_esp_mountpt}" ]]; then
sudo mount "${FLAGS_from}12" "${FLAGS_esp_mountpt}"
+ fi
}
function get_gpt_partitions() {
@@ -88,8 +91,9 @@ function get_gpt_partitions() {
function mount_image() {
mkdir -p "${FLAGS_rootfs_mountpt}"
mkdir -p "${FLAGS_stateful_mountpt}"
- test -n "${FLAGS_esp_mountpt}" && \
+ if [[ -n "${FLAGS_esp_mountpt}" ]]; then
mkdir -p "${FLAGS_esp_mountpt}"
+ fi
# Get the partitions for the image / device.
if [ -b ${FLAGS_from} ] ; then
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698