Convenience fns for tools.build scripts.
Convenience fns for tools.build scripts.
(clojure & args)
Execute clojure reproducibly (-Srepro) with the given args (strings).
Execute clojure reproducibly (-Srepro) with the given args (strings).
(clojure-capture-exceptions & args)
Execute clojure reproducibly (-Srepro) with the given args (strings), capturing stderr only (as a result map as per clojure.tools.build.api/process), and not throwing exceptions on sub-process failure (caller must check :exit status code in result).
Execute clojure reproducibly (-Srepro) with the given args (strings), capturing stderr only (as a result map as per clojure.tools.build.api/process), and not throwing exceptions on sub-process failure (caller must check :exit status code in result).
(clojure-discard-exceptions & args)
Execute clojure reproducibly (-Srepro) with the given args (strings), discarding any exception thrown by the sub-process (an exception will still thrown in this process if the exit status <> 0, however).
Execute clojure reproducibly (-Srepro) with the given args (strings), discarding any exception thrown by the sub-process (an exception will still thrown in this process if the exit status <> 0, however).
(clojure-silent & args)
Execute clojure reproducibly (-Srepro) with the given args (strings), capturing and returning stdout and stderr (as a result map as per clojure.tools.build.api/process).
Execute clojure reproducibly (-Srepro) with the given args (strings), capturing and returning stdout and stderr (as a result map as per clojure.tools.build.api/process).
(ensure-command command-name)
Ensures that the given command is available (note: POSIX only). Returns true if it exists, throws an exception otherwise.
Notes:
Ensures that the given command is available (note: POSIX only). Returns true if it exists, throws an exception otherwise. Notes: * This fn is memoized, so calling it repeatedly with the same command-name will not hurt performance.
(exec command-line)
(exec command-line opts)
Executes the given command line, expressed as either a string or a sequential (vector or list), optionally with other clojure.tools.build.api/process options as a second argument.
Throws an ExceptionInfo on non-zero status code, containing the entire execution result (from clojure.tools.build.api/process) in the info map.
Throws if the command doesn't exist.
Executes the given command line, expressed as either a string or a sequential (vector or list), optionally with other clojure.tools.build.api/process options as a second argument. Throws an ExceptionInfo on non-zero status code, containing the entire execution result (from clojure.tools.build.api/process) in the info map. Throws if the command doesn't exist.
(git & args)
Execute git with the given args (which can be strings or keywords), capturing and returning the output (stdout only).
Execute git with the given args (which can be strings or keywords), capturing and returning the output (stdout only).
(git-current-branch)
The current git branch.
The current git branch.
(git-current-commit)
The sha of the current commit.
The sha of the current commit.
(git-exact-tag)
(git-exact-tag sha)
Returns the exact tag for the given sha (or current commit sha if not provided), or nil if there is no tag for that sha.
Returns the exact tag for the given sha (or current commit sha if not provided), or nil if there is no tag for that sha.
(git-nearest-tag)
The nearest tag to the current commit.
The nearest tag to the current commit.
(git-remote)
The URL of the origin server (if any). Note: includes the .git extension.
The URL of the origin server (if any). Note: includes the .git extension.
(git-tag-commit tag)
Returns the commit sha for the given tag, or nil if the tag doesn't exist.
Returns the commit sha for the given tag, or nil if the tag doesn't exist.
(git-tag-or-hash)
Returns the tag for the current revision, or if there isn't one, the hash of the current revision.
Returns the tag for the current revision, or if there isn't one, the hash of the current revision.
(process command-line)
(process command-line opts)
Executes the given command line, expressed as either a string or a sequential (vector or list), optionally with other clojure.tools.build.api/process options as a second argument.
Caller must check :exit status code of the result to determine whether the sub-process succeeded or not.
Throws if the command doesn't exist.
Executes the given command line, expressed as either a string or a sequential (vector or list), optionally with other clojure.tools.build.api/process options as a second argument. Caller must check :exit status code of the result to determine whether the sub-process succeeded or not. Throws if the command doesn't exist.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close