Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith-cli",
"version": "0.2.1",
"version": "0.2.2",
"description": "A CLI allowing you to fetch Flagsmith flags and output them to a file",
"author": "kyle-ssg @kyle-ssg",
"bin": {
Expand Down
12 changes: 8 additions & 4 deletions src/commands/get/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ export default class FlagsmithGet extends Command {
outputString += ` for identity ${identity}`
}

const traits : Record<string, string> = {}
for (const t of flags.trait || []) {
const [k, v] = t.split(/=(.*)/s)
traits[k] = v
let traits : Record<string, string> | undefined = undefined

if(flags.trait) {
traits = {}
for (const t of flags.trait || []) {
const [k, v] = t.split(/=(.*)/s)
traits[k] = v
}
}

const output = flags.output
Expand Down