Skip to content

Commit

Permalink
add wait in setting project name
Browse files Browse the repository at this point in the history
  • Loading branch information
alekcz committed Jul 21, 2021
1 parent 5cfb5e6 commit 8d53363
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ A convenience function for generating a response map. Responses are simply Cloju
`(pcp/render-html options & content)`
Renders html from Clojure data strucutures using [hiccup](https://github.com/weavejester/hiccup)

#### pcp/render-html-unescaped
`(pcp/render-html & args)`
Renders html from Clojure data strucutures using [hiccup](https://github.com/weavejester/hiccup). Does not escape html tags strings. Use with care.

#### pcp/secret
`(pcp/secret "SECRET_NAME")`
Retrieves secret from project. The secret is read from disk. It may be worthwhile using `pcp/persist` to improve performance.
Expand All @@ -264,6 +260,12 @@ Returns the current time in milliseconds (according to your server).
`(pcp/slurp "../file-name")`
Opens a reader on f and reads all its contents, returning a string. Cannot access files higher up that project root (i.e. server root -1). Does not currently accept any optional arguments.

#### pcp/slurp-upload
`(pcp/slurp-upload "/var/tmp/temp-file-name")`
`(pcp/slurp-upload (-> pcp/request :params :uploaded :tempfile))`
Opens a reader on f and reads all its contents, returning a string. Cannot access files higher up that project root (i.e. server root -1). Does not currently accept any optional arguments.


#### pcp/spit
`(pcp/spit "../file-name" "like drugs but better")`
Opposite of slurp. Opens f with writer, writes content, then closes f. Cannot access files higher up that project root (i.e. server root -1). Does not currently accept any optional arguments.
Expand Down
2 changes: 1 addition & 1 deletion src/pcp/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
;; (pohjavirta/stop s))))

(defn serve [handler port]
(let [s (server/run-server handler {:port port})]
(let [s (server/run-server handler {:port port :max-body (* 100 1024 1024)})]
(println "running...")
(fn []
(s))))
Expand Down
3 changes: 2 additions & 1 deletion src/pcp/utility.clj
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ Options:
project-name (do (print "Project name: ") (flush) (safe-trim (read-line)))
_ (println)]
(io/make-parents keypath)
(spit keypath (prn-str {:project project-name}))))
(spit keypath (prn-str {:project project-name}))
(Thread/sleep 1000)))
(let [project (-> keypath slurp edn/read-string)
_ (do
(println "--------------------------------------------------")
Expand Down

0 comments on commit 8d53363

Please sign in to comment.