mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
replace test -n ... && clauses with proper ifs
The version of this using test -n syntax didn't work in my chroot. Review URL: http://codereview.chromium.org/2951007
This commit is contained in:
parent
07e350578b
commit
3adf3f71e9
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user