Skip to content

Commit

Permalink
Renames target names (#23)
Browse files Browse the repository at this point in the history
* Renames target names

* fix: Update import statement to use correct module name

Updated the import statement in the script to use the correct module name "Scripting" instead of "ScriptSwift" to ensure proper functionality and compatibility with the latest version of the module. Also, adjusted the documentation builder configuration to target the "Scripting" module for generating documentation.
  • Loading branch information
KS1019 authored Mar 15, 2024
1 parent 8594c13 commit fdc2f01
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [ScriptSwift]
- documentation_targets: [Scripting]
2 changes: 1 addition & 1 deletion Examples/cd.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/swift sh

import ScriptSwift // KS1019/Script.swift ~> main
import Scripting // KS1019/Script.swift ~> main

let currentDir = Script().exec("pwd").asString()

Expand Down
2 changes: 1 addition & 1 deletion Examples/curl.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/swift sh

import ScriptSwift // KS1019/Script.swift ~> main
import Scripting // KS1019/Script.swift ~> main

Script()
.exec(#"curl https://example.com"#)
Expand Down
2 changes: 1 addition & 1 deletion Examples/echo.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/swift sh

import ScriptSwift // KS1019/Script.swift ~> main
import Scripting // KS1019/Script.swift ~> main

Script()
.exec(#"echo "testing""#)
Expand Down
2 changes: 1 addition & 1 deletion Examples/stdin.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/swift sh

import ScriptSwift // KS1019/Script.swift ~> main
import Scripting // KS1019/Script.swift ~> main

Script()
.stdin()
Expand Down
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ let package = Package(
name: "Script.swift",
products: [
.library(
name: "ScriptSwift",
targets: ["ScriptSwift"])
name: "Scripting",
targets: ["Scripting"])
],
dependencies: [
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"),
.package(url: "https://github.com/JohnSundell/Files", from: "4.0.0")
],
targets: [
.target(
name: "ScriptSwift",
name: "Scripting",
dependencies: ["ShellOut", "Files"]),
.testTarget(
name: "ScriptSwiftTests",
dependencies: ["ScriptSwift"],
name: "ScriptingTests",
dependencies: ["Scripting"],
resources: [
.process("Fixtures")
])
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add this line in `dependencies` of your `Package.swift`.

Add this line at the top of your Swift script. Refer to swift-sh documentation for more details.
```swift
import ScriptSwift // KS1019/Script.swift ~> 0.0.1
import Scripting // KS1019/Script.swift ~> 0.0.1
```
## Usage

Expand All @@ -32,7 +32,7 @@ import ScriptSwift // KS1019/Script.swift ~> 0.0.1
| `concat` | Returns an array of string representation of files |
| `asArray` | Returns lines of a string as an array |

See [documentation](https://ks1019.github.io/Script.swift/documentation/ScriptSwift/) for more details.
See [documentation]() for more details.

### Using `Script.swift` with [`swift-sh`](https://github.com/mxcl/swift-sh)
When you want a script, you typically want it in a single file. With usual setup using Swift Package Manager to interact with external libraries, you would end up a directory with `Package.swift`, which is bit much as a script.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
@testable import ScriptSwift
@testable import Scripting
import ShellOut

final class ScriptUnitTests: XCTestCase {
Expand Down

0 comments on commit fdc2f01

Please sign in to comment.