Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI cannot merge different types #21

Closed
yoshiya8 opened this issue Jul 31, 2020 · 1 comment
Closed

CLI cannot merge different types #21

yoshiya8 opened this issue Jul 31, 2020 · 1 comment

Comments

@yoshiya8
Copy link

yoshiya8 commented Jul 31, 2020

Description

The clconf CLI application cannot merge different types.

How to repeat

  1. Create two files:

number.yml:

number: 100

quoted.yml:

number: "500"

Now run clconf on these two files:

clconf --yaml number.yml --yaml quoted.yml

Expected Result

number: "500"

Actual Result

Error: cannot append two different types (int, string)

Workarounds

Don't do that!

@lucastheisen
Copy link
Contributor

This was resolved by #22, and released as v2.0.16:

#!/bin/bash

set -e

readonly CLCONF="$(mktemp)"

>&2 echo -e "Downloading clconf..."
if curl \
    --output "${CLCONF}" \
    --location \
    --silent \
    https://github.com/pastdev/clconf/releases/download/v2.0.16/clconf-linux; then
  trap "rm '${CLCONF}'" EXIT
  chmod 700 "${CLCONF}"
  >&2 echo -e "$("${CLCONF}" version)\n\n"
else
  echo "unable to download clconf"
fi

"${CLCONF}" \
  --ignore-env \
  --yaml <(echo -e "---\nnumber: \"500\"") \
  --yaml <(echo -e "---\nnumber: 500") \
  getv /

Gives:

ltheisen@MM233009-PC:/tmp/ASIASETL-3394$ ./test.sh
Downloading clconf...
Version: v2.0.16


number: 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants