Skip to content

Commit a3ac739

Browse files
committed
Refactoring.
1 parent d3db50b commit a3ac739

10 files changed

+20
-189
lines changed

CODE_OF_CONDUCT.md

-77
This file was deleted.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 John Sundell
3+
Copyright (c) 2017 John Sundell, 2024 Maxim Lanskoy.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Package.resolved

-8
This file was deleted.

Package.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version: 5.9
22

33
/**
4-
* ShellOut
5-
* Copyright (c) John Sundell 2017
4+
* ShellOut | Package.swift
5+
* Copyright (c) John Sundell 2017, Maxim Lanskoy 2024.
66
* Licensed under the MIT license. See LICENSE file.
77
*/
88

README.md

+4-39
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
# 🐚 ShellOut
2+
# ShellOut
33

4-
Welcome to ShellOut, a simple package that enables you to easily “shell out” from a Swift script or command line tool.
4+
Welcome to [ShellOut](https://github.com/JohnSundell/ShellOut), a simple package that enables you to easily “shell out” from a Swift script or command line tool.
55

66
Even though you can accomplish most of the tasks you need to do in native Swift code, sometimes you need to invoke the power of the command line from a script or tool - and this is exactly what ShellOut makes so simple.
77

@@ -36,7 +36,7 @@ do {
3636

3737
## Pre-defined commands
3838

39-
Another way to use ShellOut is by executing pre-defined commands, that enable you to easily perform common tasks without having to construct commands using strings. It also ships with a set of such pre-defined commands for common tasks, such as using Git, manipulating the file system and using tools like [Marathon](https://github.com/JohnSundell/Marathon), [CocoaPods](https://cocoapods.org) and [fastlane](https://fastlane.tools).
39+
Another way to use ShellOut is by executing pre-defined commands, that enable you to easily perform common tasks without having to construct commands using strings. It also ships with a set of such pre-defined commands for common tasks, such as using Git, SPM and manipulating the file system.
4040

4141
### Use Git
4242

@@ -66,13 +66,6 @@ try shellOut(to: .expandSymlink(at: "link"))
6666

6767
*For a more powerful and object-oriented way to handle Files & Folders in Swift, check out [Files](https://github.com/JohnSundell/Files)*
6868

69-
### Use [Marathon](https://github.com/JohnSundell/Marathon)
70-
71-
```swift
72-
try shellOut(to: .runMarathonScript(at: "~/scripts/MyScript", arguments: ["One", "Two"]))
73-
try shellOut(to: .updateMarathonPackages())
74-
```
75-
7669
### Use [The Swift Package Manager](https://github.com/apple/swift-package-manager)
7770

7871
```swift
@@ -83,37 +76,9 @@ try shellOut(to: .buildSwiftPackage())
8376
try shellOut(to: .testSwiftPackage())
8477
```
8578

86-
### Use [fastlane](https://fastlane.tools)
87-
88-
```swift
89-
try shellOut(to: .runFastlane(usingLane: "appstore"))
90-
```
91-
92-
### Use [CocoaPods](https://cocoapods.org)
93-
94-
```swift
95-
try shellOut(to: .updateCocoaPods())
96-
try shellOut(to: .installCocoaPods())
97-
```
98-
9979
Don't see what you're looking for in the list above? You can easily define your own commands using `ShellOutCommand`. If you've made a command you think should be included among the built-in ones, feel free to [open a PR](https://github.com/JohnSundell/ShellOut/pull/new/master)!
10080

10181
## Installation
10282

103-
### For scripts
104-
105-
- Install [Marathon](https://github.com/johnsundell/marathon).
106-
- Add ShellOut to Marathon using `$ marathon add https://github.com/JohnSundell/ShellOut.git`.
107-
- Alternatively, add `https://github.com/JohnSundell/ShellOut.git` to your `Marathonfile`.
108-
- Write your script, then run it using `$ marathon run yourScript.swift`.
109-
110-
### For command line tools
111-
112-
- Add `.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0")` to your `Package.swift` file's `dependencies`.
83+
- Add `.package(url: "https://github.com/Maxim-Lanskoy/ShellOut.git", branch: "main")` to your `Package.swift` file's `dependencies`.
11384
- Update your packages using `$ swift package update`.
114-
115-
## Help, feedback or suggestions?
116-
117-
- [Open an issue](https://github.com/JohnSundell/ShellOut/issues/new) if you need help, if you found a bug, or if you want to discuss a feature request.
118-
- [Open a PR](https://github.com/JohnSundell/ShellOut/pull/new/master) if you want to make some change to ShellOut.
119-
- Contact [@johnsundell on Twitter](https://twitter.com/johnsundell) for discussions, news & announcements about ShellOut & other projects.

ShellOut.podspec

-17
This file was deleted.

Sources/ShellOut.swift

+2-40
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* ShellOut
3-
* Copyright (c) John Sundell 2017
2+
* ShellOut | ShellOut.swift
3+
* Copyright (c) John Sundell 2017, Maxim Lanskoy 2024.
44
* Licensed under the MIT license. See LICENSE file.
55
*/
66

@@ -266,22 +266,6 @@ public extension ShellOutCommand {
266266
}
267267
}
268268

269-
/// Marathon commands
270-
public extension ShellOutCommand {
271-
/// Run a Marathon Swift script
272-
static func runMarathonScript(at path: String, arguments: [String] = []) -> ShellOutCommand {
273-
let command = "marathon run".appending(argument: path)
274-
.appending(arguments: arguments)
275-
276-
return ShellOutCommand(string: command)
277-
}
278-
279-
/// Update all Swift packages managed by Marathon
280-
static func updateMarathonPackages() -> ShellOutCommand {
281-
return ShellOutCommand(string: "marathon update")
282-
}
283-
}
284-
285269
/// Swift Package Manager commands
286270
public extension ShellOutCommand {
287271
/// Enum defining available package types when using the Swift Package Manager
@@ -323,28 +307,6 @@ public extension ShellOutCommand {
323307
}
324308
}
325309

326-
/// Fastlane commands
327-
public extension ShellOutCommand {
328-
/// Run Fastlane using a given lane
329-
static func runFastlane(usingLane lane: String) -> ShellOutCommand {
330-
let command = "fastlane".appending(argument: lane)
331-
return ShellOutCommand(string: command)
332-
}
333-
}
334-
335-
/// CocoaPods commands
336-
public extension ShellOutCommand {
337-
/// Update all CocoaPods dependencies
338-
static func updateCocoaPods() -> ShellOutCommand {
339-
return ShellOutCommand(string: "pod update")
340-
}
341-
342-
/// Install all CocoaPods dependencies
343-
static func installCocoaPods() -> ShellOutCommand {
344-
return ShellOutCommand(string: "pod install")
345-
}
346-
}
347-
348310
/// Error type thrown by the `shellOut()` function, in case the given command failed
349311
public struct ShellOutError: Swift.Error {
350312
/// The termination status of the command that was run

Tests/LinuxMain.swift

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* ShellOut | LinuxMain.swift
3+
* Copyright (c) John Sundell 2017, Maxim Lanskoy 2024.
4+
* Licensed under the MIT license. See LICENSE file.
5+
*/
6+
17
import XCTest
28
@testable import ShellOutTests
39

Tests/ShellOutTests/ShellOutTests+Linux.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* ShellOut
3-
* Copyright (c) John Sundell 2017
2+
* ShellOut | ShellOutTests+Linux.swift
3+
* Copyright (c) John Sundell 2017, Maxim Lanskoy 2024.
44
* Licensed under the MIT license. See LICENSE file.
55
*/
66

Tests/ShellOutTests/ShellOutTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* ShellOut
3-
* Copyright (c) John Sundell 2017
2+
* ShellOut | ShellOutTests.swift
3+
* Copyright (c) John Sundell 2017, Maxim Lanskoy 2024.
44
* Licensed under the MIT license. See LICENSE file.
55
*/
66

0 commit comments

Comments
 (0)