Commit Graph

51 Commits

Author SHA1 Message Date
Kare Morstol 5dd2da16f0 Remove workaround for fixed compiler bug when printing errors. 2016-11-23 00:26:48 +01:00
Kare Morstol fe81f49fb5 Make .encoding in WriteableStream and ReadableStream public and mutable. 2016-11-16 21:02:06 +01:00
Kare Morstol 3abef0d51d Small documentation fix. 2016-11-16 21:02:06 +01:00
Kare Morstol f3f86c0c3b Improve output from *Stream.debugDescription. 2016-11-04 00:10:12 +01:00
Kare Morstol 6b5be62c18 Add debugDescription to Streams and Contexts. 2016-11-03 21:54:53 +01:00
kareman eea3cd2d61 Simplify WriteableStream.print 2016-11-01 21:46:46 +01:00
kareman 6acfe7f870 Add WriteableStream.print 2016-11-01 21:25:14 +01:00
kareman 221c9892bc Replace OSX with macOS 2016-11-01 20:37:47 +01:00
kareman f78b0bd85a Avoid crash on Linux at 'FileHandle.write()'. 2016-10-16 22:08:40 +02:00
kareman ab98f7d8e3 Fix crash on Linux when using WriteableStream.writeln(""). 2016-10-16 20:57:51 +02:00
kareman 8ce6100286 Add FileHandle.nullDev, cross-platformise some unit test. 2016-10-16 20:51:51 +02:00
kareman ef98b8da07 Get it to build on Linux. No tests yet. 2016-10-13 19:17:40 +02:00
Kare Morstol 339b5aa358 Workaround for Foundation.URL not handling leading "~". 2016-10-11 23:56:19 +02:00
Kare Morstol 7768d3a24c Make errorcode an Int. 2016-10-10 21:58:39 +02:00
Kare Morstol 84f27e4ee8 Fixed bug where runAsync did not actually run anything.
Which was bad.
2016-10-09 17:46:32 +02:00
Kare Morstol 27a7cde34a Update to Swift 3.0 final release.
3 unit tests are failing. Not sure why.
2016-09-15 13:10:30 +02:00
Kare Morstol 580cfee1c2 Update for Xcode 8 beta 2.
The Foundation Swift API keeps improving.
2016-07-10 18:01:04 +02:00
Kare Morstol 07f7141c59 Remove unnecessary Linux special handling. 2016-06-22 00:33:18 +02:00
Kare Morstol 0e14578942 Update to DEVELOPMENT-SNAPSHOT-2016-06-20-a.
Lots of name and value changes in Foundation.
Currently does not build using the Swift Package Manager ("<unknown>:0: error: Swift does not support the SDK 'MacOSX10.11.sdk'"), but builds fine from Xcode 8.
2016-06-22 00:01:27 +02:00
Kare Morstol 3bffc67f63 Move String.swift out of “General”, as it isn't. General that is. 2016-06-07 22:18:52 +02:00
Kare Morstol 191ce614a9 Almost get it to build on Linux.
Just waiting for https://github.com/apple/swift-corelibs-foundation/pull/404 to be approved.
2016-06-06 03:19:05 +02:00
Kare Morstol d678c76c73 Linux: avoid "missing _bridgeNSError" compiler crash. 2016-06-06 02:30:36 +02:00
Kare Morstol 04759e9245 Reorganise to use "swift test". Replace Xcode project with one auto-generated by swiftpm.
The “Scripts” folder is temporarily moved out of "Tests" because it doesn't work with the Swift Package Manager.
2016-06-06 01:48:36 +02:00
Kare Morstol e40e9ac014 Add FileError and improve error messages when opening files. 2016-06-05 23:15:07 +02:00
Kare Morstol 245d6845a1 Remove check for if a file is reachable from "open" functions.
Because the functionality is not implemented on Linux. It was in any case just added to improve the error messages.
2016-06-04 23:41:33 +02:00
Kare Morstol 2831504900 Mark “run” commands as having @discardableResult.
Also silence some persistent warnings in the tests.
2016-06-03 23:30:52 +02:00
Kare Morstol e6b707c9de Avoid warnings about unused results by marking functions "@discardableResult". 2016-06-03 22:26:20 +02:00
Kare Morstol ed6bc3ec6c Remove all use of Objective-C. 2016-05-25 02:39:44 +02:00
Kare Morstol 60df734a04 Workaround for nil crash in Process.arguments when run in Xcode. 2016-05-13 03:54:33 +02:00
Kare Morstol 22c30904e8 Make all unit tests pass again. 2016-05-12 23:12:26 +02:00
Kare Morstol 900a2a7f94 Work around nil crash when using Process.arguments in Xcode. 2016-05-12 04:56:25 +02:00
Kare Morstol aa80eb7932 Convert unit tests to Swift 3.0.
Currently crashes.
2016-05-12 01:59:32 +02:00
Kare Morstol 6f57644422 Update to Swift 3.0
Not the unit tests.
2016-05-12 00:37:13 +02:00
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