aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2018-11-21 15:25:51 -0800
committerTimothee Cour <timothee.cour2@gmail.com>2018-11-21 15:25:51 -0800
commitca7b37bb056a6413bfb8ed342a19941b3b3cfd81 (patch)
tree875cf5f079ecff24b39ea84412e9ce4c9809cfd2
parent773d4f9f5f3cc6b3f4247e1d8ec44ec1ee0ba8b0 (diff)
downloadnimterop-ca7b37bb056a6413bfb8ed342a19941b3b3cfd81.tar.gz
nimterop-ca7b37bb056a6413bfb8ed342a19941b3b3cfd81.zip
simplify install
-rw-r--r--README.md5
-rw-r--r--nimterop.nimble15
2 files changed, 18 insertions, 2 deletions
diff --git a/README.md b/README.md
index db0d1fd..f77debe 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,11 @@ nimble install "http://github.com/genotrance/nimtreesitter?subdir=treesitter_cpp
nimble install http://github.com/genotrance/nimterop
```
+or:
+```bash
+git clone http://github.com/genotrance/nimterop && cd nimterop
+nimble installWithDeps
+```
This will download and install nimterop in the standard Nimble package location, typically ~/.nimble. Once installed, it can be imported into any Nim program.
diff --git a/nimterop.nimble b/nimterop.nimble
index b3def89..128e2a6 100644
--- a/nimterop.nimble
+++ b/nimterop.nimble
@@ -12,8 +12,19 @@ installDirs = @["nimterop"]
requires "nim >= 0.19.0", "treesitter >= 0.1.0", "treesitter_c >= 0.1.0", "treesitter_cpp >= 0.1.0", "regex >= 0.10.0"
+proc execCmd(cmd:string)=
+ echo cmd
+ exec cmd
+
task test, "Test":
- exec "nim c -r tests/tnimterop"
+ execCmd "nim c -r tests/tnimterop"
task testext, "Test":
- exec "nim c -r tests/tnimteropext"
+ execCmd "nim c -r tests/tnimteropext"
+
+task installWithDeps, "install dependencies":
+ for a in ["http://github.com/genotrance/nimtreesitter?subdir=treesitter",
+ "http://github.com/genotrance/nimtreesitter?subdir=treesitter_c",
+ "http://github.com/genotrance/nimtreesitter?subdir=treesitter_cpp",]:
+ execCmd "nimble install -y " & a
+ execCmd "nimble install"