{"action":"closed","issue":{"url":"https://api.github.com/repos/sbt/sbt-assembly/issues/209","repository_url":"https://api.github.com/repos/sbt/sbt-assembly","labels_url":"https://api.github.com/repos/sbt/sbt-assembly/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/sbt/sbt-assembly/issues/209/comments","events_url":"https://api.github.com/repos/sbt/sbt-assembly/issues/209/events","html_url":"https://github.com/sbt/sbt-assembly/issues/209","id":151652272,"number":209,"title":"prependShellScript option results in non-portable script-JARs","user":{"login":"naegelejd","id":1110252,"avatar_url":"https://avatars.githubusercontent.com/u/1110252?v=3","gravatar_id":"","url":"https://api.github.com/users/naegelejd","html_url":"https://github.com/naegelejd","followers_url":"https://api.github.com/users/naegelejd/followers","following_url":"https://api.github.com/users/naegelejd/following{/other_user}","gists_url":"https://api.github.com/users/naegelejd/gists{/gist_id}","starred_url":"https://api.github.com/users/naegelejd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naegelejd/subscriptions","organizations_url":"https://api.github.com/users/naegelejd/orgs","repos_url":"https://api.github.com/users/naegelejd/repos","events_url":"https://api.github.com/users/naegelejd/events{/privacy}","received_events_url":"https://api.github.com/users/naegelejd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-28T14:14:45Z","updated_at":"2016-05-04T17:55:57Z","closed_at":"2016-05-04T17:55:57Z","body":"I'm using version 0.14.3.\r\n\r\nBecause the `prependShellScript` option uses `IO.writelines`, the line terminators used in the shell script in the assembled JAR are platform-dependent. This makes the resulting script non-portable (the JAR itself is OK).\r\n\r\nTo reproduce, prepend the `defaultShellScript` **on Windows**, then execute the script/JAR on a Unix-y system.\r\n\r\n1. Add the following to `build.sbt`:\r\n    ```scala\r\n    import sbtassembly.AssemblyPlugin.defaultShellScript\r\n    assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript))\r\n    ```\r\n\r\n2. Assemble on Windows: `sbt assembly`\r\n\r\n3. Run on Linux/OS X:\r\n    ```\r\n    $ ./foo-assembly-0.0.1.jar\r\n    : No such file or directory\r\n    ```\r\n\r\nI understand that a simple solution would be to assemble on the target platform, but this isn't always practical."}}