[DAEMON-83] appcd: Add support for array config values to be appended to
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2017-10-25T18:19:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Appc Daemon 1.0.0 |
Components | appcd, appcd-config, appcd-config-service |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Ewan Harris |
Created | 2017-05-10T23:08:24.000+0000 |
Updated | 2017-10-26T03:01:01.000+0000 |
Description
When a config setting is an array, there's no way to append new values. The existing value is overwritten.
This should be implemented by using the "action" property of the request payload. We already have "get", "set", and "delete". I think it makes sense to add at a minimum "shift" and "push".
If you do a "shift" or "push" and the destination does not exist, then create an empty array for the new value. If the destination exists, but it's not an array, then convert it to an array (i.e.
value = [ value ]
).
https://github.com/appcelerator/appc-daemon/pull/92