Commit Graph

63 Commits

Author SHA1 Message Date
Kare Morstol bd8ceeecbc Make RunOutput.stdout and .stderror publicly immutable. 2017-03-29 21:50:27 +02:00
Kare Morstol 755d1aa563 run() returns RunOutput instead of String. Supports || and &&. 2017-03-29 19:59:26 +02:00
Kare Morstol 21a385f198 Simplify #if statement. 2017-03-23 20:53:07 +01:00
Joe Smith 4c416f38a4 Swift 3.1 Correctly Removes Task (#35)
Looks like this may be fallout from https://bugs.swift.org/browse/SR-3279
2017-03-23 20:37:49 +01:00
Kare Morstol af7399e93a Fix up ReadableStream.onStringOutput, set framework as dependency for all unit test targets. 2017-03-02 19:15:49 +01:00
Kare Morstol bcaab22767 Require encoding for FileHandle.readSome and .read. Documentation. 2017-03-01 18:25:58 +01:00
Kare Morstol fa70e419dd Enable building for iOS. Just the Stream part. So FileSmith can use it.
The rest cannot build on iOS because it uses Process.
Move the Stream files into its own directory.
2017-02-28 01:45:24 +01:00
Miguel Angel Quinones Garcia 93b2b36d68 Fix intermediate directories not created (#32)
* Fix intermediate directories not created

If the destination path contains nonexisting directories, the function would fail where otherwise it is expected to create all directories in the path.

* Add test for creation with intermediate directories
2017-01-30 20:13:49 +01:00
Kare Morstol eca353d338 Rename WriteableStream to WritableStream.
Because that is the spelling Apple uses.
2017-01-25 18:50:56 +01:00
Kare Morstol 4145afefd8 Make the default main.stdout a StdoutStream, which uses Swift.print(). 2017-01-09 22:56:57 +01:00
Kare Morstol fa8f65e13f Make ReadableStream.lines return type prettier. 2017-01-09 22:32:47 +01:00
Kare Morstol ce44afe306 Turn WriteableStream and ReadableStream into protocols.
* Remove WriteableStream.writeln, use .print instead.
* Work around compiler crash on Linux.
2017-01-09 17:43:53 +01:00
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