File tree Expand file tree Collapse file tree 4 files changed +38
-1
lines changed
src/main/kotlin/kscript/app Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu
2+
3+ 4+
5+ RUN apt-get update
6+ RUN apt-get install -y zip
7+ RUN apt-get install -y curl
Original file line number Diff line number Diff line change 1+ # Test Protocol for Bootstrap Header
2+
3+ ``` bash
4+ cd $KSCRIPT_HOME /misc/bootstrap_tester
5+ docker build -t bstester .
6+
7+ echo " println(42)" >> bs_test.kts
8+
9+ # Enrich the script with a bootstrap header
10+ export PATH=${KSCRIPT_HOME} /build/libs:${PATH}
11+ which kscript
12+ # kscript --help
13+
14+ kscript --add-bootstrap-header bs_test.kts
15+ cat bs_test.kts
16+
17+ # spin up the container to test the
18+ # docker run --rm -v ${PWD}:/apps -it ubuntu
19+ docker run --rm -v ${PWD} :/apps -it bstester
20+ ```
21+
22+ Within the container run
23+ ``` bash
24+ cd /apps
25+ bash bs_test.kts
26+
27+ ```
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ private val BOOTSTRAP_HEADER = """
6767
6868 //usr/bin/env echo '
6969 /**** BOOTSTRAP kscript ****\'>/dev/null
70- command -v kscript >/dev/null 2>&1 || curl -L " https://git.io/fpF1K" | bash 1>&2
70+ command -v kscript >/dev/null 2>&1 || source /dev/stdin <<< " ${ ' $ ' } ( curl -L https://git.io/fpF1K)"
7171 exec kscript $0 "$@"
7272 \*** IMPORTANT: Any code including imports and annotations must come after this line ***/
7373
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/kscript/ {next} {print}'`
7070
7171For more examples see https://github.com/lehmannro/assert.sh/blob/master/tests.sh
7272
73+ ## Bootstrap Header Testing
74+
75+ See [ Test Protocol for Bootstrap Header] ( ../misc/bootstrap_tester/README.md )
7376
7477## Tests for dynamic dependencies
7578
You can’t perform that action at this time.
0 commit comments