Browse Source

Add version option for mender convert

Issues: MEN-2257

Changelog: Title

Signed-off-by: Adam Podogrocki <a.podogrocki@gmail.com>
1.1.x
Adam Podogrocki 6 years ago
parent
commit
d18a384798
  1. 19
      mender-convert

19
mender-convert

@ -133,6 +133,11 @@ Examples for expert actions:
EOF
}
show_version() {
local version=$(cd "$tool_dir" && (git describe --tags --dirty --exact-match 2>/dev/null || git rev-parse --short HEAD))
echo "mender-convert version: $version"
}
if [ $# -eq 0 ]; then
show_help
exit 1
@ -691,11 +696,6 @@ export -f mount_mender_disk
export -f log
export -f logsetup
# Before running any command first create output directory
# and configure where logs should be redirected.
mkdir -p $output_dir
logsetup
while (( "$#" )); do
case "$1" in
-p | --rootfs-partition-id)
@ -750,6 +750,10 @@ while (( "$#" )); do
keep="-k"
shift 1
;;
-v | --version)
show_version
exit 0
;;
-h | --help)
show_help
exit 0
@ -774,6 +778,11 @@ done
eval set -- "$PARAMS"
# Before running any command first create output directory
# and configure where logs should be redirected.
mkdir -p $output_dir
logsetup
# Some commands expect elevated privileges.
sudo true

Loading…
Cancel
Save