File tree 1 file changed +3
-3
lines changed
functions/sequentialthinking
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 26
26
[m]
27
27
(if (not (s/valid? ::thought-data m))
28
28
(throw (ex-info " Invalid thought data" (s/explain-data ::thought-data m)))
29
- (let [thought-history (json/parse-string (slurp " thought-history.json" ) keyword)
30
- branches (json/parse-string (slurp " branches.json" ) keyword)]
29
+ (let [thought-history (try ( json/parse-string (slurp " /sequentialthining/ thought-history.json" ) keyword) ( catch Throwable _ []) )
30
+ branches (try ( json/parse-string (slurp " branches.json" ) keyword) ( catch Throwable _ {}) )]
31
31
(spit " /sequentialthinking/thought-history.json"
32
32
(json/generate-string
33
33
(conj thought-history (cond-> m
43
43
44
44
(defn -main [& args]
45
45
(try
46
- (-> (json/parse-string (first args))
46
+ (-> (json/parse-string (first args) keyword )
47
47
(process-thought )
48
48
(json/generate-string )
49
49
(println ))
You can’t perform that action at this time.
0 commit comments