Skip to content

Ship kscript as one semi-binary file #42

@dmitry-novikov

Description

@dmitry-novikov

First of all — it works!
It's possible to ship kscript as one file with both shell script and jar files inside. To do so, just cat kscript.jar into slightly modified kscript shell script. This is how united file may looks like:

#!/usr/bin/env bash

# version tag for backward compatibility with kscript v1.x
KSCRIPT_VERSION=2.0.0

exec $(kotlin -classpath $(dirname $0)/kscript kscript.app.KscriptKt "$@")
exit

<BINARY CONTENT OF JAR FILE>

It's known feature of tar/unzip to skip any content until their own header.
I've tested this hack on java versions "1.8.0_144" / "9" and it works. With java 9 I still faced issue #41 but I think it's a different story.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions