Skip to content

Commit bba33eb

Browse files
committed
Add more features to the simple project in pm.
1 parent f18820f commit bba33eb

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

spork/pm.janet

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
(defn resolve-bundle
6767
```
6868
Convert any bundle string/table to the normalized table form. `bundle` can be any of the following forms:
69-
69+
7070
* A short name that indicates a package from the package listing.
7171
* A URL or path to a git repository
7272
* A URL or path to a .tar.gz archive
@@ -371,9 +371,6 @@
371371
### Generate new projects quickly, ported from jpm
372372
###
373373

374-
# TODO - improve on JPM style projects?
375-
# - configure a new, janet only project that doesn't depend on spork
376-
377374
(def- template-peg
378375
"Extract string pieces to generate a templating function"
379376
(peg/compile
@@ -553,6 +550,35 @@
553550
(defn install
554551
[manifest &]
555552
(bundle/add manifest "$name"))
553+
554+
(defn build
555+
[&]
556+
(print "Nothing to build!"))
557+
558+
(defn clean
559+
[&]
560+
(print "Nothing to clean!"))
561+
562+
(defn check
563+
[&]
564+
(var pass-count 0)
565+
(var total-count 0)
566+
(def failing @[])
567+
(each dir (sorted (os/dir "test"))
568+
(def path (string "test/" dir))
569+
(when (string/has-suffix? ".janet" path)
570+
(def pass (zero? (os/execute [(dyn *executable* "janet") "--" path] :p)))
571+
(++ total-count)
572+
(unless pass (array/push failing path))
573+
(when pass (++ pass-count))))
574+
(if (= pass-count total-count)
575+
(print "All tests passed!")
576+
(do
577+
(printf "%d of %d passed." pass-count total-count)
578+
(print "failing scripts:")
579+
(each f failing
580+
(print " " f))
581+
(os/exit 1))))
556582
````)
557583

558584
(deftemplate bundle-info-template

0 commit comments

Comments
 (0)