cros_choose_profile: normalize the profile dir argument

If $PWD happens to contain a dir with the same name as the profile,
the "isdir" check passes and we use the value as-is.  The point of
the check though is to look for absolute paths to profiles, so run
the argument through realpath all the time.

BUG=chromium:567959
TEST=`cros_choose_profile --profile=base` works when $PWD has a base dir

Change-Id: I6c9ebea68f0d19c3b840e42eb4e760a69336781d
Reviewed-on: https://chromium-review.googlesource.com/317110
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
1 file changed