diff --git a/.gitignore b/.gitignore index 25f93ed..54a02e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ export.json .dev.env +dev \ No newline at end of file diff --git a/tool/types.jq b/tool/lib/journalTypes.jq similarity index 87% rename from tool/types.jq rename to tool/lib/journalTypes.jq index 8af3169..0afcc5e 100644 --- a/tool/types.jq +++ b/tool/lib/journalTypes.jq @@ -1,8 +1,6 @@ include "dropins"; -import "lib/typeLib" as typeLib; - -#["DEBUG:",{"creationDate":"number","ingestions":[{"administrationRoute":"string","consumerName":"null","creationDate":"number","customUnitId":"null","dose":"number","estimatedDoseStandardDeviation":"null","isDoseAnEstimate":"boolean","notes":"string","stomachFullness":"null","substanceName":"string","time":"number","units":"string"}],"isFavorite":"boolean","location":"null","ratings":"array:empty/unknown","sortDate":"number","text":"string","timedNotes":"array:empty/unknown","title":"string"}] +import "typeLib" as typeLib; def ensureAdministrationRoute: . as $administrationRoute | diff --git a/tool/lib/substancesLib.jq b/tool/lib/substancesLib.jq new file mode 100644 index 0000000..e69de29 diff --git a/tool/main.jq b/tool/main.jq index 04570e1..da2d4e1 100644 --- a/tool/main.jq +++ b/tool/main.jq @@ -6,9 +6,9 @@ import "lib/stringLib" as stringLib; import "lib/tableLib" as tableLib; import "lib/utilsLib" as utilsLib; import "lib/journalLib" as journalLib; +import "lib/journalTypes" as journalTypes; import "journalUtils" as journalUtils; -import "types" as types; def printExperienceStats($stats; $substanceFilter; $consumerFilter; $withTitle): . as $experience | @@ -131,7 +131,7 @@ def main: ] | join("\n") | halt_error(1); $ARGS.named["exportFile"][0] as $exportData | - $exportData | types::ensureExportData | + $exportData | journalTypes::ensureExportData | ($ARGS | argsLib::parseArgs) as $parsedArgs |