Skip to content

Commit

Permalink
fix(features): an empty string was not considered a valid argument fo…
Browse files Browse the repository at this point in the history
…r featmake
  • Loading branch information
danielbraun89 authored Jan 21, 2023
1 parent 7108b19 commit 7db1fc3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions devcontainer_contrib/features/dependencies_sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
)

FEATMAKE_LINK = (
"https://github.com/devcontainers-contrib/cli/releases/download/v0.0.14/featmake"
"https://github.com/devcontainers-contrib/cli/releases/download/v0.0.15/featmake"
)
CHECKSUM_LINK = "https://github.com/devcontainers-contrib/cli/releases/download/v0.0.14/checksums.txt"
CHECKSUM_LINK = "https://github.com/devcontainers-contrib/cli/releases/download/v0.0.15/checksums.txt"

HEADER = """#!/usr/bin/env bash
# This code was generated by the devconainer-contrib cli
Expand Down
14 changes: 12 additions & 2 deletions resources/featmake/featmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,22 @@ set_envs () {
FILE_NAME=$1
shift;

if ! [ $(($# % 2)) -eq 0 ];
then
echo "Bad argument number" && exit 1;
fi

options_by_arguments=()
until [ $# -eq 0 ]
do
if ! [[ $1 == -* ]] ; then
echo "Bad argument: '$1'" && exit 1;
fi

name=${1:1}; shift;
if [[ -z "$1" || $1 == -* ]] ; then
echo "Bad argument: '$name'" && exit 1;

if [[ $1 == -* ]] ; then
echo "Bad arguments: '$name' '$1'" && exit 1;
else
export "$name"="$1"
echo "setting $name to $1"
Expand Down

0 comments on commit 7db1fc3

Please sign in to comment.