Skip to content

Commit 7d18856

Browse files
committed
FEAT: Allow tuple as a git's tag name; new --gzip flag to compress the result.
1 parent 9e15268 commit 7d18856

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

tree/rebol/Siskin/siskin.reb

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Rebol [
22
Title: "Siskin Builder - core"
33
Type: module
44
Name: siskin
5-
Version: 0.20.5
5+
Version: 0.21.0
66
Author: "Oldes"
77

88
exports: [
@@ -23,7 +23,7 @@ Rebol [
2323
banner: next rejoin [{
2424
^[[0;33m═╗
2525
^[[0;33m ║^[[1;31m .-.
26-
^[[0;33m ║^[[1;31m /'v'\ ^[[0;33mSISKIN-Framework Builder 0.20.5 Rebol } rebol/version {
26+
^[[0;33m ║^[[1;31m /'v'\ ^[[0;33mSISKIN-Framework Builder 0.21.0 Rebol } rebol/version {
2727
^[[0;33m ║^[[1;31m (/^[[0;31muOu^[[1;31m\) ^[[0;33mhttps://github.com/Siskin-framework/Builder/
2828
^[[0;33m ╚════^[[1;31m"^[[0;33m═^[[1;31m"^[[0;33m═══════════════════════════════════════════════════════════════════════^[[m}]
2929

@@ -84,6 +84,7 @@ all-options: [
8484
- "--git-ssh" - "Clone gits using password-protected SSH key"
8585
- "--no-upx" - "Ignore default project's UPX compression setting"
8686
- "--script" "path" "Evaluate Rebol script"
87+
- "--gzip" - "Compress the result with GZIP"
8788
]
8889

8990
; mapping of commands used in the interactive input into command line arguments
@@ -199,6 +200,7 @@ nest-context: object [
199200
clang?: false
200201
run-result?: false
201202
update?: false
203+
gzip?: false
202204
CI?: false
203205
target-names: copy []
204206
interactive?: false
@@ -406,6 +408,13 @@ do-upx: closure/with [file [file!]][
406408
]
407409
] :nest-context
408410

411+
gzip-file: closure/with [file [file!]][
412+
print-info ["Compress file:" file]
413+
bin: read/binary file
414+
bin: compress/level bin 'gzip 9
415+
out-file: write/binary join file %.gz bin
416+
] :nest-context
417+
409418
do-rebol2: closure/with [code [string! file!]][
410419
add-env-path root-dir
411420
rebol2: any [
@@ -576,7 +585,7 @@ parse-nest: closure/with [
576585
append dest/gits either all [git-ssh? not CI? ][
577586
as url! join "git@github.com:" [val %.git]
578587
][ join https://github.com/ [val %.git] ]
579-
) opt [set val: [refinement!] (append dest/gits val)] ;optional branch
588+
) opt [set val: [refinement! | tuple!] (append dest/gits val)] ;optional branch
580589
| quote eggs: [opt 'only (clear dest/eggs) ] set val: block! (
581590
append dest/eggs preprocess val
582591
)
@@ -997,6 +1006,7 @@ do-nest: closure/with/extern [
9971006
| 'update (update?: on)
9981007
| 'git-ssh (git-ssh?: on)
9991008
| 'no-upx (no-upx?: on)
1009+
| 'gzip (gzip?: on)
10001010
| 'output set out-file-override: skip (
10011011
out-file-override: to-rebol-file out-file-override
10021012
unless abs-path? out-file-override [
@@ -1883,6 +1893,12 @@ finalize-build: closure/with [spec [map!] file [file! none!] /no-fail][
18831893
if out-file-override [
18841894
out-file: move-file out-file out-file-override
18851895
]
1896+
if gzip? [
1897+
out-file: try/except [gzip-file out-file][
1898+
print-error system/state/last-error
1899+
out-file ;= return original file name
1900+
]
1901+
]
18861902
print-ready
18871903
return true
18881904
]
@@ -1898,7 +1914,10 @@ clone-gits: function/with [
18981914
found-git?: false
18991915
forall gits [
19001916
git: first gits
1901-
branch: either refinement? second gits [first gits: next gits][none]
1917+
branch: all [
1918+
any [refinement? gits/2 tuple? gits/2]
1919+
first gits: next gits
1920+
]
19021921
print-info ["Using git:" as-yellow git]
19031922
dir: dirize to file! first split (second split-path git) #"."
19041923
unless found-git? [

0 commit comments

Comments
 (0)