Skip to content

Commit

Permalink
Merge pull request #847 from lluiscampos/optimization-module-gen-scripts
Browse files Browse the repository at this point in the history
modules-artifact-gen: Optimization on arguments parse
  • Loading branch information
lluiscampos committed Sep 13, 2021
2 parents a77e53c + 9493754 commit f36bc6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
10 changes: 2 additions & 8 deletions support/modules-artifact-gen/directory-artifact-gen
Expand Up @@ -51,16 +51,9 @@ output_path="directory-artifact.mender"
update_files_tar="update.tar"
dest_dir_file="dest_dir"
file_tree=""
passthrough=0
passthrough_args=""

while (( "$#" )); do
if test $passthrough -eq 1
then
passthrough_args="$passthrough_args $1"
shift
continue
fi
case "$1" in
--device-type | -t)
if [ -z "$2" ]; then
Expand Down Expand Up @@ -102,8 +95,9 @@ while (( "$#" )); do
exit 0
;;
--)
passthrough=1
shift
passthrough_args="$@"
break
;;
-*)
echo "Error: unsupported option $1"
Expand Down
10 changes: 2 additions & 8 deletions support/modules-artifact-gen/docker-artifact-gen
Expand Up @@ -51,16 +51,9 @@ artifact_name=""
output_path="docker-artifact.mender"
meta_data_file="meta-data.json"
IMAGES=""
passthrough=0
passthrough_args=""

while (( "$#" )); do
if test $passthrough -eq 1
then
passthrough_args="$passthrough_args $1"
shift
continue
fi
case "$1" in
--device-type | -t)
if [ -z "$2" ]; then
Expand Down Expand Up @@ -102,8 +95,9 @@ while (( "$#" )); do
exit 0
;;
--)
passthrough=1
shift
passthrough_args="$@"
break
;;
-*)
echo "Error: unsupported option $1"
Expand Down
10 changes: 2 additions & 8 deletions support/modules-artifact-gen/single-file-artifact-gen
Expand Up @@ -49,16 +49,9 @@ artifact_name=""
dest_dir=""
output_path="single-file-artifact.mender"
file=""
passthrough=0
passthrough_args=""

while [ -n "$1" ]; do
if test $passthrough -eq 1
then
passthrough_args="$passthrough_args $1"
shift
continue
fi
case "$1" in
--device-type | -t)
if [ -z "$2" ]; then
Expand Down Expand Up @@ -100,8 +93,9 @@ while [ -n "$1" ]; do
exit 0
;;
--)
passthrough=1
shift
passthrough_args="$@"
break
;;
-*)
echo "Error: unsupported option $1"
Expand Down

0 comments on commit f36bc6b

Please sign in to comment.