Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
c734c582d4 | |||
03aab46ab5 |
@@ -5,7 +5,7 @@ is a simple file path library for Carp.
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
(load "https://veitheller.de/git/carpentry/path@0.0.2")
|
(load "git@git.veitheller.de:carpentry/path.git@0.0.4")
|
||||||
```
|
```
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
@@ -16,7 +16,7 @@ has some functions to work with the `PATH` environment variable.
|
|||||||
|
|
||||||
It assumes either Windows or POSIX-style separators.
|
It assumes either Windows or POSIX-style separators.
|
||||||
|
|
||||||
Look at [the documentation](https://veitheller.de/path) for more information.
|
Look at [the documentation](https://carpentry.dev/path) for more information.
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a href="http://github.com/carp-lang/Carp">
|
<a href="">
|
||||||
<img src="logo.png">
|
<img src="">
|
||||||
</a>
|
</a>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
path
|
path
|
||||||
@@ -25,13 +25,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="module">
|
||||||
<h1>
|
<h1>
|
||||||
Path
|
Path
|
||||||
</h1>
|
</h1>
|
||||||
<div class="module-description">
|
<div class="module-description">
|
||||||
<p>is a simple file path library for Carp.</p>
|
<p>is a simple file path library for Carp.</p>
|
||||||
<h2>Installation</h2>
|
<h2>Installation</h2>
|
||||||
<pre><code class="language-clojure">(load "https://veitheller.de/git/carpentry/path@0.0.2")
|
<pre><code class="language-clojure">(load "git@git.veitheller.de:carpentry/path.git@0.0.4")
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3>Usage</h3>
|
<h3>Usage</h3>
|
||||||
<p>The <code>Path</code> module mostly operates on <code>String</code> arguments. It allows you to
|
<p>The <code>Path</code> module mostly operates on <code>String</code> arguments. It allows you to
|
||||||
@@ -50,7 +51,7 @@ has some functions to work with the <code>PATH</code> environment variable.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [a, b] String)
|
(Fn [a, b] String)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(</> before after)
|
(</> before after)
|
||||||
@@ -70,7 +71,7 @@ has some functions to work with the <code>PATH</code> environment variable.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] (Maybe String))
|
(Fn [(Ref String a)] (Maybe String))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(absolute p)
|
(absolute p)
|
||||||
@@ -90,7 +91,7 @@ has some functions to work with the <code>PATH</code> environment variable.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] Bool)
|
(Fn [(Ref String a)] Bool)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(absolute? p)
|
(absolute? p)
|
||||||
@@ -111,7 +112,7 @@ has some functions to work with the <code>PATH</code> environment variable.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a), (Ref String b)] String)
|
(Fn [(Ref String a), (Ref String b)] String)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(add-extension p ext)
|
(add-extension p ext)
|
||||||
@@ -131,7 +132,7 @@ has some functions to work with the <code>PATH</code> environment variable.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] String)
|
(Fn [(Ref String a)] String)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(basename p)
|
(basename p)
|
||||||
@@ -151,7 +152,7 @@ has some functions to work with the <code>PATH</code> environment variable.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [] (Maybe String))
|
(Fn [] (Maybe String))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(cwd)
|
(cwd)
|
||||||
@@ -172,7 +173,7 @@ which it can fail are OS-dependent, but it should happen relatively rare.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] String)
|
(Fn [(Ref String a)] String)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(drop-extension p)
|
(drop-extension p)
|
||||||
@@ -193,7 +194,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] (Maybe String))
|
(Fn [(Ref String a)] (Maybe String))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(extension p)
|
(extension p)
|
||||||
@@ -213,7 +214,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] (Maybe String))
|
(Fn [(Ref String a)] (Maybe String))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(filename p)
|
(filename p)
|
||||||
@@ -234,7 +235,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [] (Maybe (Array String)))
|
(Fn [] (Maybe (Array String)))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(get-search-path)
|
(get-search-path)
|
||||||
@@ -254,7 +255,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] Bool)
|
(Fn [(Ref String a)] Bool)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(has-extension? p)
|
(has-extension? p)
|
||||||
@@ -274,7 +275,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a), (Ref String b)] Bool)
|
(Fn [(Ref String a), (Ref String b)] Bool)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(is-extension? p ext)
|
(is-extension? p ext)
|
||||||
@@ -294,7 +295,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref (Array String) a)] String)
|
(Fn [(Ref (Array String) a)] String)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(join ps)
|
(join ps)
|
||||||
@@ -335,7 +336,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] Bool)
|
(Fn [(Ref String a)] Bool)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(relative? p)
|
(relative? p)
|
||||||
@@ -356,7 +357,7 @@ is none.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a), (Ref String b)] String)
|
(Fn [(Ref String a), (Ref String b)] String)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(replace-extension p ext)
|
(replace-extension p ext)
|
||||||
@@ -398,7 +399,7 @@ variable we use on this OS.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [Char] Bool)
|
(Fn [Char] Bool)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(search-path-separator? c)
|
(search-path-separator? c)
|
||||||
@@ -437,7 +438,7 @@ variable we use on this OS.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref Char StaticLifetime)] Bool)
|
(Fn [(Ref Char StaticLifetime)] Bool)
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(separator? c)
|
(separator? c)
|
||||||
@@ -478,7 +479,7 @@ variable we use on this OS.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] (Array String))
|
(Fn [(Ref String a)] (Array String))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(split p)
|
(split p)
|
||||||
@@ -499,7 +500,7 @@ variable we use on this OS.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] (Maybe (Pair String String)))
|
(Fn [(Ref String a)] (Maybe (Pair String String)))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(split-extension p)
|
(split-extension p)
|
||||||
@@ -536,7 +537,7 @@ the extension.</p>
|
|||||||
defn
|
defn
|
||||||
</div>
|
</div>
|
||||||
<p class="sig">
|
<p class="sig">
|
||||||
(λ [(Ref String a)] (Array String))
|
(Fn [(Ref String a)] (Array String))
|
||||||
</p>
|
</p>
|
||||||
<pre class="args">
|
<pre class="args">
|
||||||
(split-search-path p)
|
(split-search-path p)
|
||||||
@@ -547,5 +548,6 @@ the extension.</p>
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
(load \"https://veitheller.de/git/carpentry/path@0.0.2\")
|
(load \"git@git.veitheller.de:carpentry/path.git@0.0.4\")
|
||||||
```
|
```
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
@@ -148,5 +148,5 @@ an extension if there previously was none.")
|
|||||||
(defn split-search-path [p] (String.split-by p &[search-path-separator]))
|
(defn split-search-path [p] (String.split-by p &[search-path-separator]))
|
||||||
(doc get-search-path "gets the `PATH` environment variable and splits it.")
|
(doc get-search-path "gets the `PATH` environment variable and splits it.")
|
||||||
(defn get-search-path []
|
(defn get-search-path []
|
||||||
(Maybe.apply (IO.getenv @"PATH") &(fn [p] (split-search-path &p))))
|
(Maybe.apply (IO.getenv "PATH") &(fn [p] (split-search-path &p))))
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user