Skip to content

Instantly share code, notes, and snippets.

@jacob-faber
Created May 22, 2019 18:02
Show Gist options
  • Save jacob-faber/69ac289d6d9b0de0510477c811d68ff6 to your computer and use it in GitHub Desktop.
Save jacob-faber/69ac289d6d9b0de0510477c811d68ff6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
/home/camabeh/.sdkman/candidates/kotlin/current/bin/kotlinc -script "$@"
println("Hello world")
chmod +x /tmp/kts-wrapper.kts && /tmp/kts-wrapper.kts
echo ':kotlin-script:E::kts::/tmp/kts-wrapper.sh:' | sudo tee /etc/binfmt.d/kotlin-script.conf
sudo systemctl restart systemd-binfmt.service
cat /proc/sys/fs/binfmt_misc/kotlin-script
chmod +x /tmp/main.kts && /tmp/main.kts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment