Skip to content

Commit

Permalink
Add parted error status suppressing
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtpep committed Dec 17, 2014
1 parent 8b7827a commit 287eb3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ select-drive() {
return
fi

local parted_output=`sudo LC_ALL=POSIX parted -ls 2>&1`
local parted_output=`sudo LC_ALL=POSIX parted -ls 2>&1 || :`
local exclude_drive_paths=(`mounted-drive-path /`)
exclude_drive_paths+=(`echo "$parted_output" | grep -oP "(?<=^Warning: Unable to open ).*(?= read-write )" || :`)

Expand Down Expand Up @@ -112,7 +112,8 @@ select-drive() {
}

detect-drive-name() {
drive_name=`sudo LC_ALL=POSIX parted -s $drive_path print 2>/dev/null | parse-drive-name`
local parted_output=`sudo LC_ALL=POSIX parted -s $drive_path print 2>/dev/null || :`
drive_name=`echo "$parted_output" | parse-drive-name`
}

partition-path() {
Expand Down

0 comments on commit 287eb3e

Please sign in to comment.