Browse Source

Merge pull request #56 from apodogrocki/MEN-2257

Add version option for mender-convert
1.1.x
Adam Podogrocki 6 years ago
committed by GitHub
parent
commit
852c085b35
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      mender-convert

19
mender-convert

@ -133,6 +133,11 @@ Examples for expert actions:
EOF 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 if [ $# -eq 0 ]; then
show_help show_help
exit 1 exit 1
@ -691,11 +696,6 @@ export -f mount_mender_disk
export -f log export -f log
export -f logsetup 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 while (( "$#" )); do
case "$1" in case "$1" in
-p | --rootfs-partition-id) -p | --rootfs-partition-id)
@ -750,6 +750,10 @@ while (( "$#" )); do
keep="-k" keep="-k"
shift 1 shift 1
;; ;;
-v | --version)
show_version
exit 0
;;
-h | --help) -h | --help)
show_help show_help
exit 0 exit 0
@ -774,6 +778,11 @@ done
eval set -- "$PARAMS" 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. # Some commands expect elevated privileges.
sudo true sudo true

Loading…
Cancel
Save