Skip to content

How to duplicate an item #137

@mikedowler

Description

@mikedowler

I'd like to be able to add an new entry which duplicates all the properties of an existing entry. For example, using people.json, I'd like to create Tom's evil twin, evilTom.

I can't pass a reference to an existing entry:
scout add -i /tmp/people.json "people.evilTom=people.Tom"
merely adds the string "people.Tom" to evilTom.

Capturing the output of Tom to a variable first:
tom=$(scout read -i /tmp/people.json "people.Tom")
is fine, but then adding it to a new entry
scout add -i /tmp/people.json "people.evilTom=$tom"
simply adds it as a text string, meaning it can no longer be parsed.

It seems like the only option is to read each individual property (which requires knowledge of the datatype of that property) and then write that individual property to the new location. I feel like this is a task which ought to be much easier in Scout, but would actually be easier with a text parser. Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions