new setup

This commit is contained in:
2017-12-20 17:18:58 +01:00
parent adeafb708f
commit 1bffa2af83
5 changed files with 17 additions and 88 deletions

View File

@@ -3,6 +3,11 @@ zepto
filter remove_inline ;.*$
extension zp
3rd_gen_scale 1.25
Carp
filter remove_matches ^\s*;
filter remove_inline ;.*$
extension carp
3rd_gen_scale 1.25
JSX
filter remove_matches ^\s*//
filter call_regexp_common C

View File

@@ -1,30 +0,0 @@
(define (die msg)
(begin
(write msg)
(exit 1)))
(define (usage)
(die "increment_version [position]\n\tposition defaults to 2"))
(define (parse-args)
(cond
((eq? 0 (length zepto:args)) 2)
((and (string:num? (car zepto:args))
(eq? 1 (length zepto:args)))
(string->number (car zepto:args)))
(else (usage))))
(define (main position)
(if (not (file-exists? "VERSION"))
(die "A version file is needed in the current directory")
(let* ((version (read-contents "VERSION"))
(new-version (|> (string:split version ".")
(curry map string->number)
list->vector
($ (vector:update % position add1))
(curry vector:map number->string)
($ (string:join % ".")))))
(with-output-file "VERSION" (curry write new-version)))))
(main (parse-args))
(exit 0)

View File

@@ -1,15 +0,0 @@
(load "ascii.zp")
(define cowsay (import "ascii:cowsay"))
(let ((trimmed (|> (delay (string:join zepto:args))
(lambda (x) (string:substitute x "\t" " "))
string->list
list->vector
(curry vector:reduce
(lambda (acc x) (if (and (eq? x " ") (eq? (vector:last acc) x))
acc
(++ acc x)))
{})
vector->list
list->string)))
(cowsay trimmed))
""