File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /usr/bin/env bash
2
+
3
+ # This script must be run within the ClojureScript top-level project
4
+ # directory.
5
+
6
+ set -ex
7
+
8
+ # The command `git describe --match v0.0` will return a string like
9
+ #
10
+ # v0.0-856-g329708b
11
+ #
12
+ # where 856 is the number of commits since the v0.0 tag. It will always
13
+ # find the v0.0 tag and will always return the total number of commits (even
14
+ # if the tag is v0.0.1).
15
+ REVISION=` git --no-replace-objects describe --match v0.0`
16
+
17
+ # Extract the version number from the string. Do this in two steps so
18
+ # it is a little easier to understand.
19
+ REVISION=${REVISION: 5} # drop the first 5 characters
20
+ REVISION=${REVISION: 0: ${# REVISION} -9} # drop the last 9 characters
21
+
22
+ rm -f src/cljs/cljs/core.aot.js
23
+ rm -f src/cljs/cljs/core.aot.js.map
24
+ rm -f src/cljs/cljs/core.cljs.cache.aot.edn
25
+
26
+ ./script/aot_core
27
+
28
+ AOT_FILE=` mktemp /tmp/core.aot.js.XXXXXXXXXXX`
29
+ sed -e " s/0.0-0000/0.0-$REVISION /" src/cljs/cljs/core.aot.js > $AOT_FILE
30
+ mv $AOT_FILE src/cljs/cljs/core.aot.js
31
+
32
+ AOT_CACHE_FILE=` mktemp /tmp/core.cljs.cache.aot.edn.XXXXXXXXXXX`
33
+ sed -e " s/0.0-0000/0.0-$REVISION /" src/cljs/cljs/core.cljs.cache.aot.edn > $AOT_CACHE_FILE
34
+ mv $AOT_CACHE_FILE src/cljs/cljs/core.cljs.cache.aot.edn
2
35
3
36
lein uberjar clojure.main
4
37
mv target/clojurescript-0.0-SNAPSHOT-standalone.jar target/cljs.jar
You can’t perform that action at this time.
0 commit comments