Commit Graph

18 Commits

Author SHA1 Message Date
Kare Morstol a2c79a031f Add documentation for onOutput and onStringOutput. 2016-04-28 02:12:17 +02:00
Kare Morstol 95e0207e70 Rename to onStringOutput and add onOutput. Add tests for both. 2016-04-28 01:40:18 +02:00
Kare Morstol b6dc545756 Fix indentation. 2016-04-28 00:04:16 +02:00
Kent Hinson 34e7e06a41 Fixed extension comment. 2016-04-25 19:34:51 -07:00
Kent Hinson 1f2b7e074d Added stop func to stop the task early. added async callbacks for ReadableStream.onOutput and AsyncShellTask.onCompletion allows for getting callbacks with data as the AsyncShellTask is running. 2016-04-25 19:29:27 -07:00
Kare Morstol 9ecfe91c9c Fix #16 by having WriteableStream use ‘print’ when writing to standard output.
This way print's buffering when standard output is not a terminal does not rearrange the order in which output is printed when using both 'print' and 'main.stdout.writeln'.
See also https://bugs.swift.org/browse/SR-1127 and http://stackoverflow.com/a/13933741/96587 .
2016-04-14 02:08:51 +02:00
Kare Morstol d9a3550677 Actually print error messages in release builds.
Workaround for a compiler bug where passing an NSError to exit in release builds would not print the actual error message.
2016-04-07 01:35:02 +02:00
Kare Morstol ac77eb7e6a Allow passing Ints as error codes to "exit".
Actually all exit codes should be of type Int instead of Int32. But changing it in the rest of the framework could break backwards compatibility.
2016-04-07 01:29:19 +02:00
Kare Morstol a6dab9cf38 createTempdirectory: exit with the correct error code.
… which will never happen.
2016-04-01 01:02:05 +02:00
Kare Morstol db1bbc3c26 Have main.tempdirectory use the name of the script/application.
Fall back to ‘SwiftShell’ if main.path is empty (running in a playground).
2016-04-01 00:43:23 +02:00
Kare Morstol eff36d83ec Docs: add warning about crashing if ‘executable’ is not.
Executable that is.
2016-03-31 21:43:33 +02:00
Kare Morstol 296274c63a Make AsyncShellTask a class.
It only contains objects so everything should continue working as before. It is basically a wrapper for NSTask so it should also be a class.
2016-03-31 05:08:15 +02:00
Kare Morstol 6ec5dadb96 Improve documentation for what "runAndPrint" throws. 2016-03-30 01:01:07 +02:00
Kare Morstol 02b93bc4ec Update to Swift 2.2: replace __X__ with #X. 2016-03-22 11:56:20 +01:00
Kare Morstol 97c49c031a Readme: add link to auto-generated documentation. And improved documentation. Slightly. 2016-03-21 01:04:29 +01:00
Kare Morstol b0e3796fa0 Fix #15: run("cat","longtext.txt") never finishes for large files. 2016-03-03 05:14:09 +01:00
Kare Morstol 15da28218d Add AsyncShellTask.exitcode(). 2016-02-25 03:56:23 +01:00
Kare Morstol 4916480f4e Fix #14: Support building with Swift Package Manager.
That was easier than I feared.
2016-02-23 03:17:06 +01:00